Changeset 2815 for code/branches/gui/src/core/GameState.cc
- Timestamp:
- Mar 21, 2009, 5:56:10 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/gui/src/core/GameState.cc
r1764 r2815 178 178 this->allChildren_[grandchild->getName()] = grandchild; 179 179 this->grandchildrenToChildren_[grandchild] = child; 180 if (this->getParent ())181 this->getParent ()->grandchildAdded(this, grandchild);180 if (this->getParentAsBase()) 181 this->getParentAsBase()->grandchildAdded(this, grandchild); 182 182 } 183 183 … … 196 196 this->allChildren_.erase(grandchild->getName()); 197 197 this->grandchildrenToChildren_.erase(grandchild); 198 if (this->getParent ())199 this->getParent ()->grandchildRemoved(grandchild);198 if (this->getParentAsBase()) 199 this->getParentAsBase()->grandchildRemoved(grandchild); 200 200 } 201 201 … … 208 208 GameStateBase* GameStateBase::getState(const std::string& name) 209 209 { 210 if (this->getParent ())211 return this->getParent ()->getState(name);210 if (this->getParentAsBase()) 211 return this->getParentAsBase()->getState(name); 212 212 else 213 213 { … … 227 227 GameStateBase* GameStateBase::getRoot() 228 228 { 229 if (this->getParent ())230 return this->getParent ()->getRoot();229 if (this->getParentAsBase()) 230 return this->getParentAsBase()->getRoot(); 231 231 else 232 232 return this; … … 251 251 else 252 252 { 253 if (this->getParent ())254 return this->getParent ()->getCurrentState();253 if (this->getParentAsBase()) 254 return this->getParentAsBase()->getCurrentState(); 255 255 else 256 256 return 0; … … 288 288 void GameStateBase::makeTransition(GameStateBase* source, GameStateBase* destination) 289 289 { 290 if (source == this->getParent ())290 if (source == this->getParentAsBase()) 291 291 { 292 292 // call is from the parent … … 319 319 { 320 320 // parent. We can be sure of this. 321 assert(this->getParent () != 0);321 assert(this->getParentAsBase() != 0); 322 322 323 323 this->deactivate(); 324 this->getParent ()->makeTransition(this, destination);324 this->getParentAsBase()->makeTransition(this, destination); 325 325 } 326 326 }
Note: See TracChangeset
for help on using the changeset viewer.