Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 21, 2009, 5:56:10 PM (16 years ago)
Author:
rgrieder
Message:

various small changes:

  • Fixed a bug in the GameStates concerning return type of virtual functions
  • Found some more C-style casts
File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/gui/src/core/GameState.cc

    r1764 r2815  
    178178        this->allChildren_[grandchild->getName()] = grandchild;
    179179        this->grandchildrenToChildren_[grandchild] = child;
    180         if (this->getParent())
    181             this->getParent()->grandchildAdded(this, grandchild);
     180        if (this->getParentAsBase())
     181            this->getParentAsBase()->grandchildAdded(this, grandchild);
    182182    }
    183183
     
    196196        this->allChildren_.erase(grandchild->getName());
    197197        this->grandchildrenToChildren_.erase(grandchild);
    198         if (this->getParent())
    199             this->getParent()->grandchildRemoved(grandchild);
     198        if (this->getParentAsBase())
     199            this->getParentAsBase()->grandchildRemoved(grandchild);
    200200    }
    201201
     
    208208    GameStateBase* GameStateBase::getState(const std::string& name)
    209209    {
    210         if (this->getParent())
    211             return this->getParent()->getState(name);
     210        if (this->getParentAsBase())
     211            return this->getParentAsBase()->getState(name);
    212212        else
    213213        {
     
    227227    GameStateBase* GameStateBase::getRoot()
    228228    {
    229         if (this->getParent())
    230             return this->getParent()->getRoot();
     229        if (this->getParentAsBase())
     230            return this->getParentAsBase()->getRoot();
    231231        else
    232232            return this;
     
    251251        else
    252252        {
    253             if (this->getParent())
    254                 return this->getParent()->getCurrentState();
     253            if (this->getParentAsBase())
     254                return this->getParentAsBase()->getCurrentState();
    255255            else
    256256                return 0;
     
    288288    void GameStateBase::makeTransition(GameStateBase* source, GameStateBase* destination)
    289289    {
    290         if (source == this->getParent())
     290        if (source == this->getParentAsBase())
    291291        {
    292292            // call is from the parent
     
    319319        {
    320320            // parent. We can be sure of this.
    321             assert(this->getParent() != 0);
     321            assert(this->getParentAsBase() != 0);
    322322
    323323            this->deactivate();
    324             this->getParent()->makeTransition(this, destination);
     324            this->getParentAsBase()->makeTransition(this, destination);
    325325        }
    326326    }
Note: See TracChangeset for help on using the changeset viewer.