本文整理汇总了C++中BaseFacility::setY方法的典型用法代码示例。如果您正苦于以下问题:C++ BaseFacility::setY方法的具体用法?C++ BaseFacility::setY怎么用?C++ BaseFacility::setY使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BaseFacility
的用法示例。
在下文中一共展示了BaseFacility::setY方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: viewClick
/**
* Processes clicking on facilities.
* @param action Pointer to an action.
*/
void PlaceLiftState::viewClick(Action *)
{
BaseFacility *fac = new BaseFacility(_game->getRuleset()->getBaseFacility("STR_ACCESS_LIFT"), _base);
fac->setX(_view->getGridX());
fac->setY(_view->getGridY());
_base->getFacilities()->push_back(fac);
_game->popState();
BasescapeState *bState = new BasescapeState(_game, _base, _globe);
_game->pushState(bState);
if (_first)
{
_game->pushState(new SelectStartFacilityState(_game, _base, bState, _globe));
}
}
示例2: viewClick
/**
* Processes clicking on facilities.
* @param action Pointer to an action.
*/
void PlaceFacilityState::viewClick(Action *action)
{
if (!_view->isPlaceable(_rule))
{
_game->popState();
_game->pushState(new ErrorMessageState(_game, "STR_CANNOT_BUILD_HERE", Palette::blockOffset(15)+1, "BACK01.SCR", 6));
}
else if (_game->getSavedGame()->getFunds() < _rule->getBuildCost())
{
_game->popState();
_game->pushState(new ErrorMessageState(_game, "STR_NOT_ENOUGH_MONEY", Palette::blockOffset(15)+1, "BACK01.SCR", 6));
}
else
{
BaseFacility *fac = new BaseFacility(_rule, _base);
fac->setX(_view->getGridX());
fac->setY(_view->getGridY());
fac->setBuildTime(_rule->getBuildTime());
_base->getFacilities()->push_back(fac);
_game->getSavedGame()->setFunds(_game->getSavedGame()->getFunds() - _rule->getBuildCost());
_game->popState();
}
}