Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

unit.h

Go to the documentation of this file.
00001 /***************************************************************************************************/ 00002 /***************************************************************************************************/ 00009 /***************************************************************************************************/ 00010 /***************************************************************************************************/ 00011 #ifndef UNIT_H 00012 #define UNIT_H 00013 00014 /*------------------------------------ Prototypes ---------------------------------------------*/ 00015 class cUnit; 00016 00017 /*------------------------------------ Includes ---------------------------------------------*/ 00018 #include <windows.h> 00019 #include <assert.h> 00020 #include <list> 00021 00022 #include "main.h" 00023 #include "geo_utils.h" 00024 #include "bresenham.h" 00025 #include "bonus.h" 00026 00027 #define FREQUENCY_MOVE (float)0.01 // periodicite des mouvements ( en secs); 00028 00029 /*------------------------------------- Classes ---------------------------------------------*/ 00030 00031 00032 /*************************************************************************************************/ 00034 00038 00039 class cUnit 00040 { 00041 friend class cGame_Manager; 00042 public : 00044 00050 cUnit(int x, int y, cSprite_Display_Def * display_def , int speed, int rayon); 00051 00052 inline cSprite_Display_Def * Get_Display_Def() {return pDisplay_Def;}; 00053 inline Get_Speed() { return Speed;}; 00054 inline Get_Rayon() { return Rayon;}; 00055 00057 void Display(); 00058 00060 void Move(int x_move, int y_move); 00061 00063 void Add_Node_To_Path(cPoint2D& p); 00064 00066 bool Follow_Path(); 00067 00069 void React_To_Bonus(cInteractive_Item * bonus); 00070 00071 // affiche les chemins des unités, utile pour le debug 00072 void Display_Path(); 00073 00074 int Px,Py; 00075 std::list<cPoint2D> Current_Path; 00076 bool bOn_The_Road; 00077 00078 protected: 00079 cSprite_Display_Def * pDisplay_Def; 00080 int Speed; 00081 int Rayon; 00082 cIncremental_Bresenham Bresenham_Algo; 00083 float Time_Stamp_Last_Move; 00084 00085 00086 00087 /*------------------------- fonctions d'IA ----------------------------------*/ 00088 // notes : il serait plus propre de faire un tableau de fonctions 00089 // indexées par le type de bonus auquel reagir 00090 // mais il semble qu'on ne puisse pas faire de tableau de fonctions membres 00091 // cela oblige donc à déclarer des fonctions C... 00092 // je prefere donc déclarer des fonctions qui ne font rien ( en inline ) 00093 inline virtual void React_To_Teleporteur(cTeleporteur * teleporteur){} 00094 inline virtual void React_To_Bomb(cBomb * bomb){}; 00095 inline virtual void React_To_Hologramme(cHologramme * hologramme){}; 00096 inline virtual void React_To_Cadeau(cCadeau * cadeau){}; 00097 inline virtual void React_To_Red_Trap(cRed_Trap * red_trap){}; 00098 inline virtual void React_To_Blue_Trap(cBlue_Trap * blue_trap){}; 00099 inline virtual void React_To_Green_Trap(cGreen_Trap * green_trap){}; 00100 }; 00101 00102 00103 00104 00105 #endif

Generated on Fri May 21 19:22:37 2004 for LIBELL by doxygen 1.3.7