Пример #1
0
void MarketKid::load(const VariantMap& stream)
{
  Walker::load( stream );
  _d->basket.load( stream.get( "basket" ).toList() );
  VARIANT_LOAD_ANY_D( _d, delay, stream );
  VARIANT_LOAD_ANY_D( _d, marketPos, stream );
  VARIANT_LOAD_ANY_D( _d, birthTime, stream );
}
Пример #2
0
void Player::load( const VariantMap& stream )
{
  VARIANT_LOAD_ANY_D( _d, funds, stream );
  VARIANT_LOAD_STR_D( _d, name, stream );
  VARIANT_LOAD_ANY_D( _d, salary, stream );
  VARIANT_LOAD_ANY_D( _d, color, stream );
  VARIANT_LOAD_ANY_D( _d, rank, stream );
}
Пример #3
0
void CityIndebt::load(const VariantMap& stream)
{
  GameEvent::load( stream );
  VARIANT_LOAD_ANY_D( _d, state, stream )
  VARIANT_LOAD_ANY_D( _d, isDeleted, stream )

  _d->emperorMoney << stream.get( "emperorMoney" ).toList();
  _d->text = stream.get( "text" ).toStringArray();
  _d->title = stream.get( "title" ).toStringArray();
  _d->video = stream.get( "video" ).toStringArray();
}
Пример #4
0
void GoodsUpdater::load(const VariantMap& stream)
{
  VARIANT_LOAD_TIME_D( _d, endTime, stream )
  VARIANT_LOAD_ANY_D( _d, value, stream )
  VARIANT_LOAD_CLASS_D_LIST( _d, buildings, stream )

  _d->gtype = (good::Product)good::Helper::getType( stream.get( literals::good ).toString() );
}
Пример #5
0
void PostponeEvent::load(const VariantMap& stream)
{  
  GameEvent::load( stream );

  _d->date = stream.get( "date", DateTime( -1000, 1, 1 ) ).toDateTime();
  VARIANT_LOAD_ANY_D( _d, population, stream )
  VARIANT_LOAD_ANYDEF_D( _d, checkInterval, defaultCheckInterval, stream )
  _d->options = stream;
}
Пример #6
0
void Merchant::load(const VariantMap& stream)
{
  Object::load( stream );
  VARIANT_LOAD_CLASS_D( _d, sells, stream )
  VARIANT_LOAD_CLASS_D( _d, buys, stream )
  VARIANT_LOAD_ANY_D( _d, step, stream )
  VARIANT_LOAD_STR_D( _d, baseCity, stream )
  VARIANT_LOAD_STR_D( _d, destCity, stream )

  _d->steps.load( stream.get( "steps" ).toList() );
}
Пример #7
0
    Logger::info( "HealthUpdater: execute service" );
    auto houses = _city()->statistic().houses.habitable();

    for( auto house : houses )
      house->updateState( pr::health, _d->value );
  }
}

std::string HealthUpdater::defaultName() { return "health_updater"; }
bool HealthUpdater::isDeleted() const {  return _d->isDeleted; }

void HealthUpdater::load(const VariantMap& stream)
{
  VARIANT_LOAD_TIME_D( _d, endTime, stream )
  VARIANT_LOAD_ANY_D( _d, value, stream )
}

VariantMap HealthUpdater::save() const
{
  VariantMap ret;
  VARIANT_SAVE_ANY_D( ret, _d, endTime )
  VARIANT_SAVE_ANY_D( ret, _d, value )

  return ret;
}

HealthUpdater::HealthUpdater(PlayerCityPtr city )
  : Srvc( city, HealthUpdater::defaultName() ), _d( new Impl )
{
  _d->isDeleted = false;
Пример #8
0
    HumanList citizens = _city()->statistic().walkers.find<Human>();
    citizens = citizens.random( _d->strong );

    for( auto wlk : citizens )
      wlk->die();
  }
}

std::string WrathOfVenus::defaultName() { return "wrath_of_venus"; }
bool WrathOfVenus::isDeleted() const {  return _d->isDeleted; }

void WrathOfVenus::load(const VariantMap& stream)
{
  VARIANT_LOAD_TIME_D( _d, endTime, stream )
  VARIANT_LOAD_ANY_D( _d, isDeleted, stream )
  VARIANT_LOAD_ANY_D( _d, strong, stream )
}

VariantMap WrathOfVenus::save() const
{
  VariantMap ret = Srvc::save();
  VARIANT_SAVE_ANY_D( ret, _d, endTime )
  VARIANT_SAVE_ANY_D( ret, _d, isDeleted )
  VARIANT_SAVE_ANY_D( ret, _d, strong )

  return ret;
}

WrathOfVenus::WrathOfVenus(PlayerCityPtr city )
  : Srvc( city, WrathOfVenus::defaultName() ), _d( new Impl )
Пример #9
0
void EntertainmentBuilding::load(const VariantMap& stream)
{
  ServiceBuilding::load( stream );
  VARIANT_LOAD_ANY_D( _d, showCounter, stream );
}