Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 3, 2010, 11:34:44 AM (14 years ago)
Author:
scheusso
Message:

level pointer for the baseobject

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/lod/src/libraries/core/BaseObject.h

    r6524 r6828  
    5151    class Scene;
    5252    class Gametype;
     53    class Level;
    5354
    5455    //! The BaseObject is the parent of all classes representing an instance in the game.
     
    153154            inline Gametype* getOldGametype() const { return this->oldGametype_; }
    154155            virtual void changedGametype() {}
     156           
     157            inline void setLevel(const SmartPtr<Level>& level)
     158            {
     159                if (level != this->level_)
     160                {
     161                    this->level_ = level;
     162                    this->changedLevel();
     163                }
     164            }
     165            inline const SmartPtr<Level>& getLevel() const { return this->level_; }
     166            virtual void changedLevel() {}
    155167
    156168            void addEventSource(BaseObject* source, const std::string& state);
     
    210222            SmartPtr<Gametype>     gametype_;
    211223            Gametype*              oldGametype_;
     224            SmartPtr<Level>        level_;
    212225            std::set<Template*>    templates_;
    213226
Note: See TracChangeset for help on using the changeset viewer.