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

Method checkInputCommand

source/modes/EditorMode.cpp:1010–1041  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1008}
1009
1010void EditorMode::checkInputCommand()
1011{
1012 // In the editor mode, by default, we do nothing if mouse dragged while no action selected
1013 const InputManager& inputManager = mModeManager->getInputManager();
1014
1015 switch(mPlayerSelection.getCurrentAction())
1016 {
1017 case SelectedAction::none:
1018 handlePlayerActionNone();
1019 return;
1020 case SelectedAction::changeTile:
1021 handlePlayerActionChangeTile();
1022 return;
1023 case SelectedAction::buildRoom:
1024 RoomManager::checkBuildRoomEditor(mGameMap, mPlayerSelection.getNewRoomType(), inputManager, *this);
1025 return;
1026 case SelectedAction::destroyRoom:
1027 RoomManager::checkSellRoomTilesEditor(mGameMap, inputManager, *this);
1028 return;
1029 case SelectedAction::buildTrap:
1030 TrapManager::checkBuildTrapEditor(mGameMap, mPlayerSelection.getNewTrapType(), inputManager, *this);
1031 return;
1032 case SelectedAction::destroyTrap:
1033 TrapManager::checkSellTrapTilesEditor(mGameMap, inputManager, *this);
1034 return;
1035 case SelectedAction::castSpell:
1036 // TODO: create skill entity with corresponding spell
1037 return;
1038 default:
1039 return;
1040 }
1041}
1042
1043void EditorMode::handlePlayerActionChangeTile()
1044{

Callers

nothing calls this directly

Calls 3

getCurrentActionMethod · 0.80
getNewRoomTypeMethod · 0.80
getNewTrapTypeMethod · 0.80

Tested by

no test coverage detected