private void handleZombieTurn() { Zombie zombie = (Zombie)CurrentPlayer; CombatMenu.CombatMenuItem menuItem = zombie.handleCombatChooseAction(); handleCombatMenuEvent(menuItem); }
private void determineActionByMenu(CombatMenu.CombatMenuItem menuItem) { CombatAction.ActionType actionType = CombatAction.ActionType.Choose; switch (menuItem) { case CombatMenu.CombatMenuItem.Attack: actionType = CombatAction.ActionType.Attack; break; case CombatMenu.CombatMenuItem.Move: actionType = CombatAction.ActionType.Move; break; case CombatMenu.CombatMenuItem.Defend: actionType = CombatAction.ActionType.Defend; break; case CombatMenu.CombatMenuItem.Use: actionType = CombatAction.ActionType.Use; break; case CombatMenu.CombatMenuItem.Inventory: break; case CombatMenu.CombatMenuItem.EndTurn: actionType = CombatAction.ActionType.EndTurn; break; } moveToNextAction(actionType); }
public void handleCombatMenuEvent(CombatMenu.CombatMenuItem combatMenuItem) { // The current player has picked an action. Tell the handler this action is complete. menuChoice = combatMenuItem; if (menuChoice == CombatMenu.CombatMenuItem.Attack) { // Find the weapon that was selected Player player = CurrentPlayer; InventoryStorage inventory = player.MyInventory; if (inventory != null) { player.MyWeapon = inventory.getWeapon("pistol"); } } combatActionHandler.handleActionComplete(actionType); }