MCPcopy Create free account
hub / github.com/OpenDungeons/OpenDungeons / checkInputCommand

Method checkInputCommand

source/modes/GameMode.cpp:1672–1703  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1670}
1671
1672void 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
1705void GameMode::handlePlayerActionNone()
1706{

Callers

nothing calls this directly

Calls 4

getCurrentActionMethod · 0.80
getNewRoomTypeMethod · 0.80
getNewSpellTypeMethod · 0.80
getNewTrapTypeMethod · 0.80

Tested by

no test coverage detected