예제 #1
0
        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);
        }
예제 #2
0
        public bool IsAlreadySelected(object selectedObject, Color selectColor)
        {
            if (MapObjectTypesConverter.ConvertMapAreaObjectType(selectedObject).BackColor != selectColor)
            {
                return(true);
            }

            else
            {
                WarningMessager.AlreadySelected();
                return(false);
            }
        }
예제 #3
0
        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);
        }
예제 #4
0
        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);
        }