本文整理汇总了C++中PlayerCityPtr::walkers方法的典型用法代码示例。如果您正苦于以下问题:C++ PlayerCityPtr::walkers方法的具体用法?C++ PlayerCityPtr::walkers怎么用?C++ PlayerCityPtr::walkers使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlayerCityPtr
的用法示例。
在下文中一共展示了PlayerCityPtr::walkers方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: calcVacantHouse
void Migration::Impl::createMigrationToCity( PlayerCityPtr city )
{
unsigned int vh = calcVacantHouse( city );
if( vh == 0 )
{
return;
}
EmigrantList migrants;
migrants << city->walkers();
if( vh <= migrants.size() * 5 )
{
return;
}
Tile& roadTile = city->tilemap().at( city->borderInfo().roadEntry );
ImmigrantPtr emigrant = Immigrant::create( city );
if( emigrant.isValid() )
{
bool success = emigrant->send2city( roadTile );
emigrant->setSpeedMultiplier( 0.8f + math::random( 40 ) / 100.f );
if( success )
lastMonthComing += emigrant->peoples().count();
}
}
示例2: _doWrath
void Neptune::_doWrath(PlayerCityPtr city)
{
GameEventPtr event = ShowInfobox::create( _("##wrath_of_neptune_title##"),
_("##wrath_of_neptune_description##"),
ShowInfobox::send2scribe,
"god_neptune");
event->dispatch();
ShipList boats;
boats << city->walkers();
ShipList destroyBoats = boats.random( 5 );
for( auto ship : destroyBoats )
{
ship->die();
}
}
示例3: _doBlessing
void Mars::_doBlessing(PlayerCityPtr city)
{
EnemySoldierList enemies;
enemies << city->walkers( walker::any );
bool blessingDone = false;
int step = enemies.size() / 3;
for( int k=0; k < step; k++ )
{
int index = math::random( enemies.size() );
EnemySoldierList::iterator it = enemies.begin();
std::advance( it, index );
(*it)->die();
blessingDone = true;
}
if( blessingDone )
{
events::GameEventPtr event = events::ShowInfobox::create( _("##spirit_of_mars_title##"),
_("##spirit_of_mars_text##"),
events::ShowInfobox::send2scribe );
event->dispatch();
}
}