public void ExecuteUnitCommand() { UnitCommand unitCommand = unitCommandsToExecute.Dequeue(); unitCommand.Execute(); unitCommandsExecuted.Enqueue(unitCommand); }
private void HandleGamepadButton(string buttonName, UnitCommand command, Unit unit, float amount) { var buttonDown = Input.GetButton(buttonName); if (buttonDown && command != null) { command.Execute(unit, amount); } }
private void HandleKeyDown(KeyCode keyCode, UnitCommand command, Unit unit, float amount) { var isKeyDown = Input.GetKeyDown(keyCode); if (isKeyDown && command != null) { command.Execute(unit, amount); } }
private void HandleAxis(string axisName, UnitCommand command, Unit unit) { var axisAmount = Input.GetAxis(axisName); if (axisAmount != 0 && command != null) { command.Execute(unit, axisAmount); } }
/// <summary> /// Issue a command to the active unit. /// </summary> /// <param name="command"></param> public void ExecuteCommand(UnitCommand command) { command.Execute(this, selectedUnit); }