- Timestamp:
- Jun 3, 2012, 6:05:24 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/presentation2012merge/src/modules/towerdefense/TowerDefense.h
r9271 r9272 26 26 * 27 27 */ 28 28 29 29 /** 30 31 32 33 30 @brief 31 GameType class for TowerDefense. See TowerDefenseReadme.txt for Information. 32 33 @ingroup TowerDefense 34 34 */ 35 35 36 36 37 37 #ifndef _TowerDefense_H__ … … 40 40 #include "towerdefense/TowerDefensePrereqs.h" 41 41 #include "gametypes/Deathmatch.h" 42 42 43 43 #include "TowerDefensePlayerStats.h" 44 44 45 45 namespace orxonox 46 46 { 47 47 class _TowerDefenseExport TowerDefense : public Deathmatch 48 48 { 49 public: 50 TowerDefense(BaseObject* creator); 51 virtual ~TowerDefense(); 52 53 virtual void start(); //<! The function is called when the gametype starts 54 virtual void end(); 55 virtual void tick(float dt); 56 //virtual void playerEntered(PlayerInfo* player); 57 //virtual bool playerLeft(PlayerInfo* player); 58 59 //virtual void pawnKilled(Pawn* victim, Pawn* killer = 0); 60 //virtual void playerScored(PlayerInfo* player); 61 62 63 /* Called by TowerDefenseCenterpoint upon game start 64 The centerpoint is used to create towers 65 */ 66 void setCenterpoint(TowerDefenseCenterpoint *centerpoint); 67 68 /* Adds a tower at x, y in the playfield */ 69 void addTower(int x, int y); 70 71 /* Part of a temporary hack to allow the player to add towers */ 72 ConsoleCommand* dedicatedAddTower_; 73 74 //TODO: void spawnNewWave() 75 //TODO: create a timer which regularly calls the spawnNewWave function (time driven) 76 // or spawn a new wave when the old wave has been killed (event driven) 49 public: 50 TowerDefense(BaseObject* creator); 51 virtual ~TowerDefense(); 52 53 virtual void start(); //<! The function is called when the gametype starts 54 virtual void end(); 55 virtual void tick(float dt); 56 //virtual void playerEntered(PlayerInfo* player); 57 //virtual bool playerLeft(PlayerInfo* player); 58 59 //virtual void pawnKilled(Pawn* victim, Pawn* killer = 0); 60 //virtual void playerScored(PlayerInfo* player); 77 61 78 62 79 private: 80 TowerDefenseCenterpoint *center_; 81 82 /* handles stats */ 83 TowerDefensePlayerStats *stats_; 84 bool hasEnoughCreditForTower(TowerCost towerCost); 85 86 bool towerExists(int x, int y); 87 88 typedef struct { 89 int x; 90 int y; 91 } Coordinate; 92 93 std::vector<Coordinate> addedTowersCoordinates_; 94 std::vector<Tower*> towers_; 63 /* Called by TowerDefenseCenterpoint upon game start 64 The centerpoint is used to create towers 65 */ 66 void setCenterpoint(TowerDefenseCenterpoint *centerpoint); 67 68 /* Adds a tower at x, y in the playfield */ 69 void addTower(int x, int y); 70 71 /* Part of a temporary hack to allow the player to add towers */ 72 ConsoleCommand* dedicatedAddTower_; 73 74 //TODO: void spawnNewWave() 75 //TODO: create a timer which regularly calls the spawnNewWave function (time driven) 76 // or spawn a new wave when the old wave has been killed (event driven) 77 78 79 private: 80 TowerDefenseCenterpoint *center_; 81 82 /* handles stats */ 83 TowerDefensePlayerStats *stats_; 84 bool hasEnoughCreditForTower(TowerCost towerCost); 85 86 bool towerExists(int x, int y); 87 88 typedef struct { 89 int x; 90 int y; 91 } Coordinate; 92 93 std::vector<Coordinate> addedTowersCoordinates_; 94 std::vector<Tower*> towers_; 95 95 }; 96 96 }
Note: See TracChangeset
for help on using the changeset viewer.