public bool SelectSelectorStateArea(Button selectedArea, int selectorPlayerNumber) { int selectedStateNumber = selectedTakeOverAreaNodes.First().ownedStateNumber; if (IsSelectorPlayerState(selectedArea, selectorPlayerNumber)) { if (IsAreaAdjacent(selectedArea, selectedStateNumber, selectorBetAreaNodes)) { AreaSelectNode saverButton = new AreaSelectNode() { ownedStateNumber = StateFlag.GetPlayerNumberWithFlag(selectedArea.BackColor), currentFlag = selectedArea.BackColor, areaNumber = int.Parse(selectedArea.Name) }; selectorBetAreaNodes.Push(saverButton); selectedArea.BackColor = Color.White; return(true); } else { WarningMessager.AreaNotAdjacent(); } } else { WarningMessager.NotSelectorPlayerState(); } return(false); }
public bool IsAlreadySelected(object selectedObject, Color selectColor) { if (MapObjectTypesConverter.ConvertMapAreaObjectType(selectedObject).BackColor != selectColor) { return(true); } else { WarningMessager.AlreadySelected(); return(false); } }
public bool TryCaptureAreas() { selectedStateNumber = areaSelector.GetSelectedStateNumber(); Stack <AreaSelectNode> requestedAreas = areaSelector.GetTakeOverAreas(); Stack <AreaSelectNode> betAreas = areaSelector.GetSelectorBetAreas(); if (requestedAreas.Count != 0 && requestedAreas.Count == betAreas.Count) { warPlugin.AreaRequest(selectorStateNumber, selectedStateNumber, requestedAreas, betAreas); return(true); } else { WarningMessager.AreasNotEquals(); } return(false); }
public bool SelectOtherStateArea(Button selectedArea, int selectorPlayerNumber) { if (!IsSelectorPlayerState(selectedArea, selectorPlayerNumber)) { if (!IsStateOfAnotherEnemyPlayer(selectedArea)) { if (IsAreaAdjacent(selectedArea, selectorPlayerNumber, selectedTakeOverAreaNodes)) { AreaSelectNode areaNode = new AreaSelectNode() { ownedStateNumber = StateFlag.GetPlayerNumberWithFlag(selectedArea.BackColor), currentFlag = selectedArea.BackColor, areaNumber = int.Parse(selectedArea.Name) }; selectedTakeOverAreaNodes.Push(areaNode); selectedArea.BackColor = Color.Black; return(true); } else { WarningMessager.AreaNotAdjacent(); } } else { WarningMessager.StateOfEnemyPlayer(); } } else { WarningMessager.SelectorPlayerState(); } return(false); }