public CombatScreen(Game game) { this.game = game; dataMaster = new DataMaster(game); DataMaster = dataMaster; unitHandler = new UnitHandler(game, this); interfaceHandler = new InterfaceHandler(this); masterRenderer = new MasterRenderer(dataMaster); }
/// <summary> /// This method make sure that you can only select one button att a time and /// also make so that when you select a button the button before will /// deselect. /// </summary> /// <param name="selectedButton"></param> /// <param name="status"></param> private void selectButtonAndStatus(Button selectedButton, UnitHandler.UnitStatus status) { if (curentSelectedButton == null) { curentSelectedButton = selectedButton; curentSelectedButton.Selected = true; screen.UnitHandler.CurrentUnitStatus = status; } else if (selectedButton == curentSelectedButton) { curentSelectedButton.Selected = false; curentSelectedButton = null; screen.UnitHandler.CurrentUnitStatus = UnitHandler.UnitStatus.NONE; } else if (curentSelectedButton != null) { curentSelectedButton.Selected = false; curentSelectedButton = selectedButton; curentSelectedButton.Selected = true; screen.UnitHandler.CurrentUnitStatus = status; } }