Changeset 10769 for code/branches/cpp11_v2/src/libraries/core/Game.cc
- Timestamp:
- Nov 7, 2015, 10:23:42 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/cpp11_v2/src/libraries/core/Game.cc
r10768 r10769 73 73 std::string name_; 74 74 weak_ptr<GameStateTreeNode> parent_; 75 std::vector<shared_ptr<GameStateTreeNode> 75 std::vector<shared_ptr<GameStateTreeNode>> children_; 76 76 }; 77 77 … … 384 384 385 385 // Check children first 386 std::vector<shared_ptr<GameStateTreeNode> 386 std::vector<shared_ptr<GameStateTreeNode>> requestedNodes; 387 387 for (unsigned int i = 0; i < lastRequestedNode->children_.size(); ++i) 388 388 { … … 454 454 { 455 455 // Split string into pieces of the form whitespacesText 456 std::vector<std::pair<std::string, int> 456 std::vector<std::pair<std::string, int>> stateStrings; 457 457 size_t pos = 0; 458 458 size_t startPos = 0; … … 473 473 474 474 // Parse elements recursively 475 std::vector<std::pair<std::string, int> 475 std::vector<std::pair<std::string, int>>::const_iterator begin = stateStrings.begin(); 476 476 parseStates(begin, this->rootStateNode_); 477 477 } … … 479 479 /*** Internal ***/ 480 480 481 void Game::parseStates(std::vector<std::pair<std::string, int> 481 void Game::parseStates(std::vector<std::pair<std::string, int>>::const_iterator& it, shared_ptr<GameStateTreeNode> currentNode) 482 482 { 483 483 SubString tokens(it->first, ","); 484 std::vector<std::pair<std::string, int> 484 std::vector<std::pair<std::string, int>>::const_iterator startIt = it; 485 485 486 486 for (unsigned int i = 0; i < tokens.size(); ++i) … … 620 620 } 621 621 622 /*static*/ std::map<std::string, shared_ptr<Game::GameStateFactory> 623 { 624 static std::map<std::string, shared_ptr<GameStateFactory> 622 /*static*/ std::map<std::string, shared_ptr<Game::GameStateFactory>>& Game::GameStateFactory::getFactories() 623 { 624 static std::map<std::string, shared_ptr<GameStateFactory>> factories; 625 625 return factories; 626 626 } … … 628 628 /*static*/ shared_ptr<GameState> Game::GameStateFactory::fabricate(const GameStateInfo& info) 629 629 { 630 std::map<std::string, shared_ptr<Game::GameStateFactory> 630 std::map<std::string, shared_ptr<Game::GameStateFactory>>::const_iterator it = getFactories().find(info.className); 631 631 assert(it != getFactories().end()); 632 632 return it->second->fabricateInternal(info);
Note: See TracChangeset
for help on using the changeset viewer.