bool LowBridge::canBuild( const city::AreaInfo& areaInfo ) const
{
  TilePos endPos, startPos;
  _d->direction = direction::none;

  OverlayPtr bridge = areaInfo.city->getOverlay( areaInfo.pos );
  if( bridge.isNull() )
  {
    _d->subtiles.clear();
    LowBridge* thisp = const_cast< LowBridge* >( this );
    thisp->_fgPictures().clear();

    _checkParams( areaInfo.city, _d->direction, startPos, endPos, areaInfo.pos );

    if( _d->direction != direction::none)
    {
      thisp->_computePictures( areaInfo.city, startPos, endPos, _d->direction );
    }
  }

  return (_d->direction != direction::none);
}
Beispiel #2
0
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);
}