示例#1
0
MarketKidPtr MarketKid::create(PlayerCityPtr city, MarketBuyerPtr lady )
{
  MarketKidPtr ret( new MarketKid( city ) );
  ret->setPos( lady->pos() );
  ret->_pathwayRef() = lady->pathway();

  ret->drop();

  return ret;
}
示例#2
0
void Market::deliverService()
{
  if( numberWorkers() > 0 && walkers().size() == 0 )
  {
    // the marketBuyer is ready to buy something!
    MarketBuyerPtr buyer = MarketBuyer::create( _city() );
    buyer->send2City( this );

    if( !buyer->isDeleted() )
    {
      addWalker( buyer.object() );
    }
    else if( _d->isAnyGoodStored() )
    {
      ServiceBuilding::deliverService();
    }
  }
}
示例#3
0
void Market::deliverService()
{
  if( getWorkers() > 0 && _getWalkerList().size() == 0 )
  {
    // the marketBuyer is ready to buy something!
    MarketBuyerPtr buyer = MarketBuyer::create( MarketPtr( this ) );
    buyer->send2City();

    if( !buyer->isDeleted() )
    {
      _addWalker( buyer.as<Walker>() );
    }
    else if( _d->isAnyGoodStored() )
    {
      ServiceBuilding::deliverService();
    }
  }
}