| 1008 | } |
| 1009 | |
| 1010 | void 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 | |
| 1043 | void EditorMode::handlePlayerActionChangeTile() |
| 1044 | { |
nothing calls this directly
no test coverage detected