MCPcopy Create free account
hub / github.com/bwapi/bwapi / chooseNewRandomMap

Method chooseNewRandomMap

bwapi/BWAPI/Source/BWAPI/AutoMenuManager.cpp:149–167  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

147}
148
149void AutoMenuManager::chooseNewRandomMap()
150{
151 if (!this->autoMapPool.empty())
152 {
153 std::string chosen;
154 if (this->autoMapIteration == "RANDOM")
155 {
156 // Obtain a random map file
157 std::sample(autoMapPool.begin(), autoMapPool.end(), &chosen, 1, mt);
158 }
159 else if (this->autoMapIteration == "SEQUENCE")
160 {
161 if (this->lastAutoMapEntry >= this->autoMapPool.size())
162 this->lastAutoMapEntry = 0;
163 chosen = this->autoMapPool[this->lastAutoMapEntry++];
164 }
165 this->lastMapGen = this->autoMenuMapPath + chosen;
166 }
167}
168
169unsigned int getLobbyPlayerCount()
170{

Callers 3

reloadConfigMethod · 0.95
onMenuFrameMethod · 0.95
onGameEndMethod · 0.80

Calls 3

beginMethod · 0.80
endMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected