Пример #1
0
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();
    }
  }
Пример #2
0
int main(int argc, char** argv) {
  GameLoader gl;
  gl.load();
  return 1;
}