| 1670 | } |
| 1671 | |
| 1672 | void GameMode::checkInputCommand() |
| 1673 | { |
| 1674 | // In the gamemode, by default, we select tiles |
| 1675 | const InputManager& inputManager = mModeManager->getInputManager(); |
| 1676 | |
| 1677 | switch(mPlayerSelection.getCurrentAction()) |
| 1678 | { |
| 1679 | case SelectedAction::none: |
| 1680 | handlePlayerActionNone(); |
| 1681 | return; |
| 1682 | case SelectedAction::selectTile: |
| 1683 | handlePlayerActionSelectTile(); |
| 1684 | return; |
| 1685 | case SelectedAction::buildRoom: |
| 1686 | RoomManager::checkBuildRoom(mGameMap, mPlayerSelection.getNewRoomType(), inputManager, *this); |
| 1687 | return; |
| 1688 | case SelectedAction::destroyRoom: |
| 1689 | RoomManager::checkSellRoomTiles(mGameMap, inputManager, *this); |
| 1690 | return; |
| 1691 | case SelectedAction::castSpell: |
| 1692 | SpellManager::checkSpellCast(mGameMap, mPlayerSelection.getNewSpellType(), inputManager, *this); |
| 1693 | return; |
| 1694 | case SelectedAction::buildTrap: |
| 1695 | TrapManager::checkBuildTrap(mGameMap, mPlayerSelection.getNewTrapType(), inputManager, *this); |
| 1696 | return; |
| 1697 | case SelectedAction::destroyTrap: |
| 1698 | TrapManager::checkSellTrapTiles(mGameMap, inputManager, *this); |
| 1699 | return; |
| 1700 | default: |
| 1701 | return; |
| 1702 | } |
| 1703 | } |
| 1704 | |
| 1705 | void GameMode::handlePlayerActionNone() |
| 1706 | { |
nothing calls this directly
no test coverage detected