Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 26, 2009, 2:15:08 PM (15 years ago)
Author:
rgrieder
Message:

Loading and unloading graphics automatically: As soon as a GameState requires graphics (defined at the GameState declaration with a bool) it gets loaded. And vice versa.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/resource/src/core/GameState.h

    r3280 r3355  
    4545    /**
    4646    @brief
    47         Helper class to group construction parameters for better genericity.
    48     */
    49     struct GameStateConstrParams
    50     {
    51         std::string name;
    52         bool bIgnoreTickTime;
    53     };
    54 
    55     /**
    56     @brief
    5747        An implementation of a tree to manage game states.
    5848        This leads to a certain hierarchy that is created at runtime.
     
    8777
    8878    public:
    89         GameState(const GameStateConstrParams& params);
     79        GameState(const GameStateInfo& info);
    9080        virtual ~GameState();
    9181
    92         const std::string& getName() const { return name_; }
    93         State getActivity()          const { return this->activity_; }
    94         GameState* getParent()       const { return this->parent_; }
    95 
    96         bool ignoreTickTime()        const { return this->bIgnoreTickTime_; }
     82        const std::string& getName()   const;
     83        State getActivity()            const { return activity_; }
     84        GameState* getParent()         const { return parent_; }
     85        const GameStateInfo& getInfo() const { return info_; }
    9786
    9887        void addChild(GameState* state);
     
    111100        void updateInternal(const Clock& time);
    112101
    113         const std::string                        name_;
     102        const GameStateInfo&                     info_;
    114103        State                                    activity_;
    115         const bool                               bIgnoreTickTime_;
    116104        GameState*                               parent_;
    117105        std::map<std::string, GameState*>        children_;
Note: See TracChangeset for help on using the changeset viewer.