Changeset 2662 for code/trunk/src/orxonox/objects/gametypes/Gametype.h
- Timestamp:
- Feb 14, 2009, 10:17:35 PM (16 years ago)
- Location:
- code/trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/src/orxonox/objects/gametypes/Gametype.h
r2171 r2662 38 38 #include "objects/worldentities/ControllableEntity.h" 39 39 #include "objects/Tickable.h" 40 #include "objects/infos/GametypeInfo.h" 40 41 41 42 namespace orxonox … … 52 53 } 53 54 55 struct Player 56 { 57 PlayerInfo* info_; 58 PlayerState::Enum state_; 59 int frags_; 60 int killed_; 61 }; 62 54 63 class _OrxonoxExport Gametype : public BaseObject, public Tickable 55 64 { … … 60 69 virtual ~Gametype() {} 61 70 71 void setConfigValues(); 72 62 73 virtual void tick(float dt); 63 74 75 inline const GametypeInfo* getGametypeInfo() const 76 { return &this->gtinfo_; } 77 64 78 inline bool hasStarted() const 65 { return this-> bStarted_; }79 { return this->gtinfo_.bStarted_; } 66 80 inline bool hasEnded() const 67 { return this-> bEnded_; }81 { return this->gtinfo_.bEnded_; } 68 82 69 83 virtual void start(); … … 75 89 virtual void playerChangedName(PlayerInfo* player); 76 90 77 virtual void playerScored(Player Info*player);91 virtual void playerScored(Player& player); 78 92 79 93 virtual void pawnKilled(Pawn* victim, Pawn* killer = 0); … … 81 95 virtual void pawnPostSpawn(Pawn* pawn); 82 96 83 inline const std::map<PlayerInfo*, Player State::Enum>& getPlayers() const97 inline const std::map<PlayerInfo*, Player>& getPlayers() const 84 98 { return this->players_; } 85 99 … … 88 102 89 103 inline bool isStartCountdownRunning() const 90 { return this-> bStartCountdownRunning_; }104 { return this->gtinfo_.bStartCountdownRunning_; } 91 105 inline float getStartCountdown() const 92 { return this->startCountdown_; } 106 { return this->gtinfo_.startCountdown_; } 107 108 void addBots(unsigned int amount); 109 void killBots(unsigned int amount = 0); 110 111 inline unsigned int getNumberOfPlayers() const 112 { return this->players_.size(); } 93 113 94 114 private: … … 104 124 void spawnDeadPlayersIfRequested(); 105 125 106 bool bStarted_;107 bool bEnded_; 126 GametypeInfo gtinfo_; 127 108 128 bool bAutoStart_; 109 129 bool bForceSpawn_; 110 130 111 131 float initialStartCountdown_; 112 float startCountdown_; 113 bool bStartCountdownRunning_; 132 unsigned int numberOfBots_; 114 133 115 std::map<PlayerInfo*, Player State::Enum> players_;134 std::map<PlayerInfo*, Player> players_; 116 135 std::set<SpawnPoint*> spawnpoints_; 117 136 SubclassIdentifier<ControllableEntity> defaultControllableEntity_; 137 138 OverlayGroup* scoreboard_; 139 140 // Config Values 141 std::string scoreboardTemplate_; 118 142 }; 119 143 }
Note: See TracChangeset
for help on using the changeset viewer.