Esempio n. 1
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();
    }
  }
}
Esempio n. 2
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();
    }
  }
}