Пример #1
0
        List <PanelAreaType> GetReachPanelAreaTypeList(TurnType turnType)
        {
            var area1 = PanelAreaList.FirstOrDefault(x => x.PanelAreaType == PanelAreaType.Area1);
            var area2 = PanelAreaList.FirstOrDefault(x => x.PanelAreaType == PanelAreaType.Area2);
            var area3 = PanelAreaList.FirstOrDefault(x => x.PanelAreaType == PanelAreaType.Area3);
            var area4 = PanelAreaList.FirstOrDefault(x => x.PanelAreaType == PanelAreaType.Area4);
            var area5 = PanelAreaList.FirstOrDefault(x => x.PanelAreaType == PanelAreaType.Area5);
            var area6 = PanelAreaList.FirstOrDefault(x => x.PanelAreaType == PanelAreaType.Area6);
            var area7 = PanelAreaList.FirstOrDefault(x => x.PanelAreaType == PanelAreaType.Area7);
            var area8 = PanelAreaList.FirstOrDefault(x => x.PanelAreaType == PanelAreaType.Area8);
            var area9 = PanelAreaList.FirstOrDefault(x => x.PanelAreaType == PanelAreaType.Area9);

            List <PanelAreaType> reachPanelAreaTypeList = new List <PanelAreaType>();

            // Vertical
            addPanelAreaTypeWhenReach(reachPanelAreaTypeList, turnType, area1, area2, area3);
            addPanelAreaTypeWhenReach(reachPanelAreaTypeList, turnType, area4, area5, area6);
            addPanelAreaTypeWhenReach(reachPanelAreaTypeList, turnType, area7, area8, area9);

            // Horizontal
            addPanelAreaTypeWhenReach(reachPanelAreaTypeList, turnType, area1, area4, area7);
            addPanelAreaTypeWhenReach(reachPanelAreaTypeList, turnType, area2, area5, area8);
            addPanelAreaTypeWhenReach(reachPanelAreaTypeList, turnType, area3, area6, area9);

            // Diagonal
            addPanelAreaTypeWhenReach(reachPanelAreaTypeList, turnType, area1, area5, area9);
            addPanelAreaTypeWhenReach(reachPanelAreaTypeList, turnType, area3, area5, area7);

            return(reachPanelAreaTypeList);
        }
Пример #2
0
        public PanelAreaType SelectPanelArea(PlayerEntity player, PanelAreaType panelAreaType)
        {
            var turnType = player.Equals(_1stPlayer) ? TurnType._1stPlayer : TurnType._2ndPlayer;
            var panel    = PanelAreaList.FirstOrDefault(x => x.PanelAreaType == panelAreaType);

            panel.SetTurnType(turnType);

            return(panelAreaType);
        }