Changeset 5868 for code/branches/core5/src/libraries/core/Game.cc
- Timestamp:
- Oct 4, 2009, 12:03:14 AM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/core5/src/libraries/core/Game.cc
r5855 r5868 117 117 Game::Game(const std::string& cmdLine) 118 118 // Destroy factories before the Core! 119 : gsFactoryDestroyer_(Game::GameStateFactory:: factories_s, &std::map<std::string, shared_ptr<GameStateFactory> >::clear)119 : gsFactoryDestroyer_(Game::GameStateFactory::getFactories(), &std::map<std::string, shared_ptr<GameStateFactory> >::clear) 120 120 { 121 121 this->bAbort_ = false; … … 624 624 } 625 625 626 std::map<std::string, shared_ptr<Game::GameStateFactory> > Game::GameStateFactory::factories_s; 626 /*static*/ std::map<std::string, shared_ptr<Game::GameStateFactory> >& Game::GameStateFactory::getFactories() 627 { 628 static std::map<std::string, shared_ptr<GameStateFactory> > factories; 629 return factories; 630 } 627 631 628 632 /*static*/ shared_ptr<GameState> Game::GameStateFactory::fabricate(const GameStateInfo& info) 629 633 { 630 std::map<std::string, shared_ptr<Game::GameStateFactory> >::const_iterator it = factories_s.find(info.className);631 assert(it != factories_s.end());634 std::map<std::string, shared_ptr<Game::GameStateFactory> >::const_iterator it = getFactories().find(info.className); 635 assert(it != getFactories().end()); 632 636 return it->second->fabricateInternal(info); 633 637 }
Note: See TracChangeset
for help on using the changeset viewer.