Changeset 10771 for code/branches/cpp11_v2/src/libraries/core/Game.h
- Timestamp:
- Nov 7, 2015, 5:24:58 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v2/src/libraries/core/Game.h
r10769 r10771 44 44 #include <string> 45 45 #include <vector> 46 #include < boost/shared_ptr.hpp>46 #include <memory> 47 47 #include <boost/preprocessor/cat.hpp> 48 48 … … 84 84 { // tolua_export 85 85 friend class Singleton<Game>; 86 typedef std::vector<s hared_ptr<GameState>> GameStateVector;87 typedef std::map<std::string, s hared_ptr<GameState>> GameStateMap;88 typedef s hared_ptr<GameStateTreeNode> GameStateTreeNodePtr;86 typedef std::vector<std::shared_ptr<GameState>> GameStateVector; 87 typedef std::map<std::string, std::shared_ptr<GameState>> GameStateMap; 88 typedef std::shared_ptr<GameStateTreeNode> GameStateTreeNodePtr; 89 89 90 90 public: … … 97 97 98 98 void setStateHierarchy(const std::string& str); 99 s hared_ptr<GameState> getState(const std::string& name);99 std::shared_ptr<GameState> getState(const std::string& name); 100 100 101 101 void run(); … … 123 123 public: 124 124 virtual ~GameStateFactory() { } 125 static s hared_ptr<GameState> fabricate(const GameStateInfo& info);125 static std::shared_ptr<GameState> fabricate(const GameStateInfo& info); 126 126 template <class T> 127 127 static void createFactory(const std::string& className) 128 128 { getFactories()[className].reset(new TemplateGameStateFactory<T>()); } 129 129 130 virtual s hared_ptr<GameState> fabricateInternal(const GameStateInfo& info) = 0;131 static std::map<std::string, s hared_ptr<GameStateFactory>>& getFactories();130 virtual std::shared_ptr<GameState> fabricateInternal(const GameStateInfo& info) = 0; 131 static std::map<std::string, std::shared_ptr<GameStateFactory>>& getFactories(); 132 132 }; 133 133 template <class T> … … 135 135 { 136 136 public: 137 s hared_ptr<GameState> fabricateInternal(const GameStateInfo& info)138 { return s hared_ptr<GameState>(new T(info)); }137 std::shared_ptr<GameState> fabricateInternal(const GameStateInfo& info) 138 { return std::shared_ptr<GameState>(new T(info)); } 139 139 }; 140 140 … … 150 150 void unloadGraphics(bool loadGraphicsManagerWithoutRenderer = true); 151 151 152 void parseStates(std::vector<std::pair<std::string, int>>::const_iterator& it, s hared_ptr<GameStateTreeNode> currentNode);152 void parseStates(std::vector<std::pair<std::string, int>>::const_iterator& it, std::shared_ptr<GameStateTreeNode> currentNode); 153 153 bool checkState(const std::string& name) const; 154 154 void loadState(const std::string& name);
Note: See TracChangeset
for help on using the changeset viewer.