Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 20, 2010, 10:23:22 AM (15 years ago)
Author:
scheusso
Message:

merging lod branch into presentation3 merger branch

Location:
code/branches/presentation3
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/presentation3

  • code/branches/presentation3/src/libraries/core/BaseObject.cc

    r6800 r6926  
    7575            this->setScene(this->creator_->getScene(), this->creator_->getSceneID());
    7676            this->setGametype(this->creator_->getGametype());
     77            this->setLevel(this->creator_->getLevel());
    7778        }
    7879        else
     
    8384            this->sceneID_ = OBJECTID_UNKNOWN;
    8485            this->gametype_ = 0;
     86            this->level_ = 0;
    8587        }
    8688    }
  • code/branches/presentation3/src/libraries/core/BaseObject.h

    r6800 r6926  
    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);
     
    209221            SmartPtr<Gametype>     gametype_;
    210222            Gametype*              oldGametype_;
     223            SmartPtr<Level>        level_;
    211224            std::set<Template*>    templates_;
    212225
Note: See TracChangeset for help on using the changeset viewer.