Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 31, 2008, 5:50:42 PM (16 years ago)
Author:
rgrieder
Message:

Modified the GameState hierarchy so that you can get the parent with the actual type by calling getParent().

File:
1 edited

Legend:

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

    r1674 r1688  
    4545    GameState::GameState(const std::string& name)
    4646        : name_(name)
    47         , parent_(0)
     47        //, parent_(0)
    4848        , activeChild_(0)
    49         //, bPauseParent_(false)
     49        //, bPausegetParent()(false)
    5050    {
    5151        Operations temp = {false, false, false, false, false};
     
    103103
    104104        // mark us as parent
    105         state->parent_ = this;
     105        state->setParent(this);
    106106    }
    107107
     
    178178        this->allChildren_[grandchild->getName()] = grandchild;
    179179        this->grandchildrenToChildren_[grandchild] = child;
    180         if (this->parent_)
    181             this->parent_->grandchildAdded(this, grandchild);
     180        if (this->getParent())
     181            this->getParent()->grandchildAdded(this, grandchild);
    182182    }
    183183
     
    196196        this->allChildren_.erase(grandchild->getName());
    197197        this->grandchildrenToChildren_.erase(grandchild);
    198         if (this->parent_)
    199             this->parent_->grandchildRemoved(grandchild);
     198        if (this->getParent())
     199            this->getParent()->grandchildRemoved(grandchild);
    200200    }
    201201
     
    208208    GameState* GameState::getState(const std::string& name)
    209209    {
    210         if (this->parent_)
    211             return this->parent_->getState(name);
     210        if (this->getParent())
     211            return this->getParent()->getState(name);
    212212        else
    213213        {
     
    227227    GameState* GameState::getRoot()
    228228    {
    229         if (this->parent_)
    230             return this->parent_->getRoot();
     229        if (this->getParent())
     230            return this->getParent()->getRoot();
    231231        else
    232232            return this;
Note: See TracChangeset for help on using the changeset viewer.