void Game::load(std::string filename) { StringHelper::debug( 0xff, "Load game begin" ); _d->empire->initialize( GameSettings::rcpath( GameSettings::citiesModel ) ); GameLoader loader; _d->loadOk = loader.load( filename, *this); if( !_d->loadOk ) { StringHelper::debug( 0xff, "LOADING ERROR: can't load game from %s", filename.c_str() ); return; } _d->empire->initPlayerCity( _d->city.as<EmpireCity>() ); LandOverlayList& llo = _d->city->getOverlayList(); foreach( LandOverlayPtr overlay, llo ) { ConstructionPtr construction = overlay.as<Construction>(); if( construction.isValid() ) { construction->computeAccessRoads(); } }
void GameMenuView::OpenLoadDialog() { Pi::EndGame(); GameLoader loader; loader.DialogMainLoop(); Game *newGame = loader.GetGame(); if (newGame) { Pi::game = newGame; Pi::InitGame(); Pi::StartGame(); } }
int main(int argc, char** argv) { GameLoader gl; gl.load(); return 1; }