Changeset 10575 for code/branches/core7/src/orxonox/gametypes/Gametype.cc
- Timestamp:
- Sep 9, 2015, 2:02:01 PM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core7/src/orxonox/gametypes/Gametype.cc
r10555 r10575 64 64 65 65 this->gtinfo_ = new GametypeInfo(context); 66 this->gtinfo_->setGametype(this);67 66 68 67 this->defaultControllableEntity_ = Class(Spectator); 68 this->scoreboard_ = 0; 69 69 70 70 this->bAutoStart_ = false; … … 81 81 this->setConfigValues(); 82 82 83 ModifyConsoleCommand(__CC_addBots_name).setObject(this); 84 ModifyConsoleCommand(__CC_killBots_name).setObject(this); 85 } 86 87 Gametype::~Gametype() 88 { 89 if (this->isInitialized()) 90 { 91 if (this->gtinfo_) 92 this->gtinfo_->destroy(); 93 94 ModifyConsoleCommand(__CC_addBots_name).setObject(NULL); 95 ModifyConsoleCommand(__CC_killBots_name).setObject(NULL); 96 } 97 } 98 99 /** 100 * @brief Initializes sub-objects of the Gametype. This must be called after the constructor. 101 * At this point, the context is expected to have the current gametype. This allows to pass the current gametype to the sub-objects via constructor. 102 */ 103 void Gametype::init() 104 { 83 105 // load the corresponding score board 84 106 if (GameMode::showsGraphics() && !this->scoreboardTemplate_.empty()) 85 107 { 86 this->scoreboard_ = new OverlayGroup( context);108 this->scoreboard_ = new OverlayGroup(this->getContext()); 87 109 this->scoreboard_->addTemplate(this->scoreboardTemplate_); 88 this->scoreboard_->setGametype(this);89 }90 else91 this->scoreboard_ = 0;92 93 ModifyConsoleCommand(__CC_addBots_name).setObject(this);94 ModifyConsoleCommand(__CC_killBots_name).setObject(this);95 }96 97 Gametype::~Gametype()98 {99 if (this->isInitialized())100 {101 if (this->gtinfo_)102 this->gtinfo_->destroy();103 104 ModifyConsoleCommand(__CC_addBots_name).setObject(NULL);105 ModifyConsoleCommand(__CC_killBots_name).setObject(NULL);106 110 } 107 111 }
Note: See TracChangeset
for help on using the changeset viewer.