Changeset 8930 for code/branches/gamecontent/src
- Timestamp:
- Nov 9, 2011, 4:16:24 PM (13 years ago)
- Location:
- code/branches/gamecontent/src/orxonox
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/gamecontent/src/orxonox/gametypes/Gametype.cc
r8858 r8930 85 85 this->dedicatedKillBots_ = createConsoleCommand( "dedicatedKillBots", createExecutor( createFunctor(&Gametype::killBots, this) ) ); 86 86 /* HACK HACK HACK */ 87 //this->numberOfPlayers_ = 0; 87 88 } 88 89 -
code/branches/gamecontent/src/orxonox/gametypes/Gametype.h
r8904 r8930 155 155 virtual void resetTimer(); 156 156 virtual void resetTimer(float t); 157 inline unsigned int getNumberOfPlayers() 158 { return this->gtinfo_->getNumberOfPlayers(); } 157 159 158 160 protected: … … 192 194 ConsoleCommand* dedicatedKillBots_; 193 195 /* HACK HACK HACK */ 196 194 197 }; 195 198 } -
code/branches/gamecontent/src/orxonox/gametypes/TeamGametype.cc
r8923 r8930 31 31 #include "core/CoreIncludes.h" 32 32 #include "core/ConfigValueIncludes.h" 33 #include "infos/PlayerInfo.h" 33 34 #include "interfaces/TeamColourable.h" 34 35 #include "worldentities/TeamSpawnPoint.h" … … 45 46 this->teams_ = 2; 46 47 this->allowFriendlyFire_ = false; 47 48 //this->playersPerTeam_ = 0; 49 this->maxPlayers_ = 0; 48 50 this->setConfigValues(); 49 51 } … … 104 106 } 105 107 108 void TeamGametype::spawnDeadPlayersIfRequested() 109 { 110 for (std::map<PlayerInfo*, Player>::iterator it = this->players_.begin(); it != this->players_.end(); 111 ++it) 112 if (it->second.state_ == PlayerState::Dead) 113 { 114 if ((it->first->isReadyToSpawn() || this->bForceSpawn_)) 115 { 116 this->spawnPlayer(it->first); 117 } 118 } 119 } 120 121 106 122 bool TeamGametype::allowPawnHit(Pawn* victim, Pawn* originator) 107 123 {// hit allowed: if victim & originator are foes or if originator doesnot exist or if friendlyfire is allowed -
code/branches/gamecontent/src/orxonox/gametypes/TeamGametype.h
r8923 r8930 49 49 virtual void findAndSetTeam(PlayerInfo* player); 50 50 virtual bool playerLeft(PlayerInfo* player); 51 virtual void spawnDeadPlayersIfRequested(); //!< Prevents players to respawn. 51 52 52 53 virtual bool allowPawnHit(Pawn* victim, Pawn* originator = 0); … … 55 56 56 57 virtual void playerStartsControllingPawn(PlayerInfo* player, Pawn* pawn); 58 57 59 58 60 int getTeam(PlayerInfo* player); … … 68 70 std::map<PlayerInfo*, int> teamnumbers_; 69 71 std::vector<ColourValue> teamcolours_; 70 unsigned int teams_; 72 unsigned int teams_; //<! Number of teams. Value 0 : no teams! 73 //unsigned int playersPerTeam_; //<! Defines Maximum for players per team. Value 0: no maximum! 74 unsigned int maxPlayers_; //<! Defines Maximum for number of players. Value 0 : no maximum! 71 75 }; 72 76 } -
code/branches/gamecontent/src/orxonox/infos/GametypeInfo.h
r8706 r8930 119 119 inline const std::string& getHUDTemplate() const 120 120 { return this->hudtemplate_; } 121 122 inline unsigned int getNumberOfPlayers() const 123 { return this->spawnedPlayers_.size(); } 121 124 122 125 void sendAnnounceMessage(const std::string& message);
Note: See TracChangeset
for help on using the changeset viewer.