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

Method setMap

bwapi/BWAPI/Source/BWAPI/GameImpl.cpp:841–855  ·  view source on GitHub ↗

---------------------------------------------------- SET MAP ---------------------------------------------

Source from the content-addressed store, hash-verified

839 }
840 //---------------------------------------------------- SET MAP ---------------------------------------------
841 bool GameImpl::setMap(const char *mapFileName)
842 {
843 if ( !mapFileName || strlen(mapFileName) >= std::extent<decltype(BW::BWDATA::Game.mapFileName)>::value || !mapFileName[0] )
844 return setLastError(Errors::Invalid_Parameter);
845
846 if ( !std::ifstream(mapFileName).is_open() )
847 return setLastError(Errors::File_Not_Found);
848
849 if ( !this->tournamentCheck(Tournament::SetMap, (void*)mapFileName) )
850 return setLastError(Errors::None);
851
852
853 strcpy(BW::BWDATA::Game.mapFileName, mapFileName);
854 return setLastError(Errors::None);
855 }
856 //------------------------------------------------- ELAPSED TIME -------------------------------------------
857 int GameImpl::elapsedTime() const
858 {

Callers 1

processCommandsMethod · 0.45

Calls 1

tournamentCheckMethod · 0.95

Tested by

no test coverage detected