* Processes clicking on facilities. * @param action Pointer to an action. */
| 59 | * @param action Pointer to an action. |
| 60 | */ |
| 61 | void PlaceStartFacilityState::viewClick(Action *) |
| 62 | { |
| 63 | if (!_view->isPlaceable(_rule)) |
| 64 | { |
| 65 | _game->popState(); |
| 66 | _game->pushState(new ErrorMessageState(_game, "STR_CANNOT_BUILD_HERE", _palette, Palette::blockOffset(15)+1, "BACK01.SCR", 6)); |
| 67 | } |
| 68 | else |
| 69 | { |
| 70 | BaseFacility *fac = new BaseFacility(_rule, _base); |
| 71 | fac->setX(_view->getGridX()); |
| 72 | fac->setY(_view->getGridY()); |
| 73 | _base->getFacilities()->push_back(fac); |
| 74 | _game->popState(); |
| 75 | _select->facilityBuilt(); |
| 76 | } |
| 77 | } |
| 78 | |
| 79 | } |
nothing calls this directly
no test coverage detected