本文整理汇总了C++中PlayerCityPtr::getOverlay方法的典型用法代码示例。如果您正苦于以下问题:C++ PlayerCityPtr::getOverlay方法的具体用法?C++ PlayerCityPtr::getOverlay怎么用?C++ PlayerCityPtr::getOverlay使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlayerCityPtr
的用法示例。
在下文中一共展示了PlayerCityPtr::getOverlay方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _reachedWay
void PlayerArmy::_reachedWay()
{
if( _d->mode == PlayerArmy::go2location )
{
_attackAny();
return2fort();
}
else if( _d->mode == PlayerArmy::go2home )
{
PlayerCityPtr pCity = ptr_cast<PlayerCity>( _d->base );
if( pCity.isValid() )
{
for( auto sldr : _d->soldiersInfo )
{
int type = sldr.save[ "type" ];
WalkerPtr walker = WalkerManager::instance().create( (walker::Type)type, pCity );
walker->load( sldr.save );
walker->attach();
}
auto fort = pCity->getOverlay( _d->fortPos ).as<Fort>();
if( fort.isValid() )
{
fort->returnSoldiers();
fort->resetExpedition();
}
}
deleteLater();
}
}
示例2: canBuild
bool LowBridge::canBuild(PlayerCityPtr city, TilePos pos, const TilesArray& ) const
{
//bool is_constructible = Construction::canBuild( pos );
TilePos endPos, startPos;
_d->direction=noneDirection;
TileOverlayPtr bridge = city->getOverlay( pos );
if( bridge.isNull() )
{
_d->subtiles.clear();
LowBridge* thisp = const_cast< LowBridge* >( this );
thisp->_fgPicturesRef().clear();
_checkParams( city, _d->direction, startPos, endPos, pos );
if( _d->direction != noneDirection )
{
thisp->_computePictures( city, startPos, endPos, _d->direction );
}
}
return (_d->direction != noneDirection);
}