Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Aug 29, 2009, 10:19:38 PM (15 years ago)
Author:
landauf
Message:

merged libraries branch back to trunk

Location:
code/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/trunk

  • code/trunk/src/core/Game.h

    r3370 r5693  
    4848
    4949#include "util/Debug.h"
     50#include "util/ScopeGuard.h"
    5051#include "util/Singleton.h"
    5152
     
    8586        typedef std::map<std::string, shared_ptr<GameState> > GameStateMap;
    8687        typedef boost::shared_ptr<GameStateTreeNode> GameStateTreeNodePtr;
     88
    8789    public:
    8890        Game(const std::string& cmdLine);
     
    118120            static void createFactory(const std::string& className)
    119121                { factories_s[className].reset(new TemplateGameStateFactory<T>()); }
    120         private:
     122
    121123            virtual shared_ptr<GameState> fabricateInternal(const GameStateInfo& info) = 0;
    122124            static std::map<std::string, shared_ptr<GameStateFactory> > factories_s;
     
    129131                { return shared_ptr<GameState>(new T(info)); }
    130132        };
     133        // For the factory destruction
     134        typedef Loki::ObjScopeGuardImpl0<std::map<std::string, shared_ptr<GameStateFactory> >, void (std::map<std::string, shared_ptr<GameStateFactory> >::*)()> ObjScopeGuard;
    131135
    132136        struct StatisticsTickInfo
     
    156160        scoped_ptr<Clock>                  gameClock_;
    157161        scoped_ptr<Core>                   core_;
     162        ObjScopeGuard                      gsFactoryDestroyer_;
    158163        scoped_ptr<GameConfiguration>      configuration_;
    159164
Note: See TracChangeset for help on using the changeset viewer.