本文整理汇总了C++中HousePtr::getGoodStore方法的典型用法代码示例。如果您正苦于以下问题:C++ HousePtr::getGoodStore方法的具体用法?C++ HousePtr::getGoodStore怎么用?C++ HousePtr::getGoodStore使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类HousePtr
的用法示例。
在下文中一共展示了HousePtr::getGoodStore方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getTile
void House::_tryUpdate_1_to_11_lvl( int level4grow, int startSmallPic, int startBigPic, const char desirability )
{
if( getSize() == 1 )
{
Tilemap& tmap = _getCity()->getTilemap();
TilemapTiles area = tmap.getFilledRectangle( getTile().getIJ(), Size(2) );
bool mayGrow = true;
foreach( Tile* tile, area )
{
if( tile == NULL )
{
mayGrow = false; //some broken, can't grow
break;
}
HousePtr house = tile->getOverlay().as<House>();
if( house != NULL && house->getLevelSpec().getHouseLevel() == level4grow )
{
if( house->getSize().getWidth() > 1 ) //bigger house near, can't grow
{
mayGrow = false;
break;
}
}
else
{
mayGrow = false; //no house near, can't grow
break;
}
}
if( mayGrow )
{
int sumHabitants = getNbHabitants();
int sumFreeWorkers = _d->freeWorkersCount;
TilemapTiles::iterator delIt=area.begin();
HousePtr selfHouse = (*delIt)->getOverlay().as<House>();
delIt++; //don't remove himself
for( ; delIt != area.end(); delIt++ )
{
HousePtr house = (*delIt)->getOverlay().as<House>();
if( house.isValid() )
{
house->deleteLater();
house->_d->currentHabitants = 0;
sumHabitants += house->getNbHabitants();
sumFreeWorkers += house->_d->freeWorkersCount;
selfHouse->getGoodStore().storeAll( house->getGoodStore() );
}
}
_d->currentHabitants = sumHabitants;
_d->freeWorkersCount = sumFreeWorkers;
_d->houseLevelSpec = HouseSpecHelper::getInstance().getHouseLevelSpec(_d->houseLevel);
_d->nextHouseLevelSpec = _d->houseLevelSpec.next();
_update();
_updateDesirabilityInfluence( Construction::duNegative );
setSize( getSize() + Size(1) );
build( _getCity(), getTile().getIJ() );
}
}