---------------------------------------------------- SET MAP ---------------------------------------------
| 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 | { |
no test coverage detected