#include <unit.h>
Inheritance diagram for cUnit:
Public Member Functions | |
cUnit (int x, int y, cSprite_Display_Def *display_def, int speed, int rayon) | |
constructeur | |
cSprite_Display_Def * | Get_Display_Def () |
Get_Speed () | |
Get_Rayon () | |
void | Display () |
affiche l'unité ( via la classe d'affichage ) | |
void | Move (int x_move, int y_move) |
bouge la unit selon le vecteur (x_move, y_move) | |
void | Add_Node_To_Path (cPoint2D &p) |
ajoute un noeud au chemin en cours | |
bool | Follow_Path () |
avance d'un pas dans le chemin en cours, retourne vrai si arrivé, false sinon | |
void | React_To_Bonus (cInteractive_Item *bonus) |
reagit au contact du 'bonus' | |
void | Display_Path () |
Public Attributes | |
int | Px |
int | Py |
position de l'unité | |
std::list< cPoint2D > | Current_Path |
chemin à suivre par l'unité | |
bool | bOn_The_Road |
indique que l'unité est en train de suivre un chemin | |
Protected Member Functions | |
virtual void | React_To_Teleporteur (cTeleporteur *teleporteur) |
virtual void | React_To_Bomb (cBomb *bomb) |
virtual void | React_To_Hologramme (cHologramme *hologramme) |
virtual void | React_To_Cadeau (cCadeau *cadeau) |
virtual void | React_To_Red_Trap (cRed_Trap *red_trap) |
virtual void | React_To_Blue_Trap (cBlue_Trap *blue_trap) |
virtual void | React_To_Green_Trap (cGreen_Trap *green_trap) |
Protected Attributes | |
cSprite_Display_Def * | pDisplay_Def |
classe de definition de l'affichage | |
int | Speed |
vitesse de l'unité | |
int | Rayon |
rayon de l'emplacement au sol | |
cIncremental_Bresenham | Bresenham_Algo |
algorithme de bresenham, utile pour aller d'un point à un autre | |
float | Time_Stamp_Last_Move |
moment auquel on a effectué le dernier mouvement |
La class cUnit est une classe générique pour représenter toute unité mobile du jeu
! Pour ce jeu, toutes les unités sont définis par un point 2D (x,y) qui représente leur centre
! Elles ont aussi un rayon, qui défini leur emplacement au sol ( pour les collisions )
! Chaque elt a un pointeur vers un objet cAbtract_Display_Def qui défini sa méthode d'affichage
Definition at line 39 of file unit.h.
|
constructeur
x,y : position de l'unité à rajouter Definition at line 15 of file unit.cpp. References bOn_The_Road, cUnit(), Current_Path, DXUtil_Timer(), FREQUENCY_MOVE, pDisplay_Def, Px, Py, Rayon, Speed, Time_Stamp_Last_Move, and TIMER_GETAPPTIME. Referenced by cUnit(). |
|
ajoute un noeud au chemin en cours
Definition at line 59 of file unit.cpp. References Add_Node_To_Path(), and Current_Path. Referenced by Add_Node_To_Path(). |
|
affiche l'unité ( via la classe d'affichage )
Definition at line 137 of file unit.cpp. References cSprite_Display_Def::Display(), pDisplay_Def, Px, Py, Rayon, TX_SCREEN, and TY_SCREEN. Referenced by cGame_Manager::Display(). |
|
Definition at line 258 of file unit.cpp. References Current_Path, Draw_Line(), and g_pDisplay. |
|
avance d'un pas dans le chemin en cours, retourne vrai si arrivé, false sinon
Definition at line 65 of file unit.cpp. References bOn_The_Road, Bresenham_Algo, Current_Path, DXUtil_Timer(), FREQUENCY_MOVE, Px, Py, Rayon, cIncremental_Bresenham::Reset(), Speed, cIncremental_Bresenham::Step(), Time_Stamp_Last_Move, TIMER_GETAPPTIME, TX_SCREEN, TY_SCREEN, cPoint2D::X, and cPoint2D::Y. |
|
Definition at line 52 of file unit.h. References pDisplay_Def. |
|
Definition at line 54 of file unit.h. References Rayon. Referenced by cGame_Manager::Is_Free_Place(), and cGame_Manager::Test_Collisions(). |
|
Definition at line 53 of file unit.h. References Speed. Referenced by cGame_Manager::Read_Keyboard_And_React(). |
|
bouge la unit selon le vecteur (x_move, y_move)
Definition at line 149 of file unit.cpp. References cGame_World::Do_Ball_Intersect_Walls(), DXUtil_Timer(), FREQUENCY_MOVE, Game_Manager, cGame_Manager::Game_World, cPoint2D::Get_X(), cPoint2D::Get_Y(), Move(), cRectangle::p0, cRectangle::p1, Px, Py, Rayon, Time_Stamp_Last_Move, and TIMER_GETAPPTIME. Referenced by Move(), and cGame_Manager::Read_Keyboard_And_React(). |
|
Reimplemented in cBlue_Ball. Definition at line 98 of file unit.h. References React_To_Blue_Trap(). Referenced by React_To_Blue_Trap(), and React_To_Bonus(). |
|
Reimplemented in cEnnemy, and cPlayer. Definition at line 94 of file unit.h. References React_To_Bomb(). Referenced by React_To_Bomb(), and React_To_Bonus(). |
|
reagit au contact du 'bonus'
Definition at line 30 of file unit.cpp. References BLUE_TRAP, BOMB, CADEAU, GREEN_TRAP, HOLOGRAMME, React_To_Blue_Trap(), React_To_Bomb(), React_To_Bonus(), React_To_Cadeau(), React_To_Green_Trap(), React_To_Hologramme(), React_To_Red_Trap(), React_To_Teleporteur(), RED_TRAP, TELEPORTEUR, and cInteractive_Item::Type. Referenced by React_To_Bonus(), and cGame_Manager::Test_Collisions(). |
|
Reimplemented in cEnnemy, and cPlayer. Definition at line 96 of file unit.h. References React_To_Cadeau(). Referenced by React_To_Bonus(), and React_To_Cadeau(). |
|
Reimplemented in cGreen_Ball. Definition at line 99 of file unit.h. References React_To_Green_Trap(). Referenced by React_To_Bonus(), and React_To_Green_Trap(). |
|
Reimplemented in cEnnemy. Definition at line 95 of file unit.h. References React_To_Hologramme(). Referenced by React_To_Bonus(), and React_To_Hologramme(). |
|
Reimplemented in cRed_Ball. Definition at line 97 of file unit.h. References React_To_Red_Trap(). Referenced by React_To_Bonus(), and React_To_Red_Trap(). |
|
Reimplemented in cEnnemy. Definition at line 93 of file unit.h. References React_To_Teleporteur(). Referenced by React_To_Bonus(), and React_To_Teleporteur(). |
|
indique que l'unité est en train de suivre un chemin
Definition at line 76 of file unit.h. Referenced by cUnit(), and Follow_Path(). |
|
algorithme de bresenham, utile pour aller d'un point à un autre
Definition at line 82 of file unit.h. Referenced by Follow_Path(). |
|
chemin à suivre par l'unité
Definition at line 75 of file unit.h. Referenced by Add_Node_To_Path(), cUnit(), Display_Path(), and Follow_Path(). |
|
classe de definition de l'affichage
Definition at line 79 of file unit.h. Referenced by cUnit(), Display(), and Get_Display_Def(). |
|
|
position de l'unité
Definition at line 74 of file unit.h. Referenced by cUnit(), Display(), Follow_Path(), cGreen_Ball::Get_Destination(), cBlue_Ball::Get_Destination(), cRed_Ball::Get_Destination(), cEnnemy::Get_Destination(), cGame_Manager::Is_Free_Place(), Move(), cGame_Manager::Read_Keyboard_And_React(), cLevel_Loader::Read_Player(), and cGame_Manager::Test_Collisions(). |
|
rayon de l'emplacement au sol
Definition at line 81 of file unit.h. Referenced by cUnit(), Display(), Follow_Path(), Get_Rayon(), and Move(). |
|
vitesse de l'unité
Definition at line 80 of file unit.h. Referenced by cUnit(), Follow_Path(), and Get_Speed(). |
|
moment auquel on a effectué le dernier mouvement
Definition at line 83 of file unit.h. Referenced by cUnit(), Follow_Path(), Move(), and cGame_Manager::Start(). |