MarketKidPtr MarketKid::create(PlayerCityPtr city, MarketBuyerPtr lady ) { MarketKidPtr ret( new MarketKid( city ) ); ret->setPos( lady->pos() ); ret->_pathwayRef() = lady->pathway(); ret->drop(); return ret; }
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(); } } }
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(); } } }