Esempio n. 1
0
            public static List <Pos> CanKill(Figure thfg, Pos cell, byte owner, IList <Figure> pieces)
            {
                if (thfg.Owner == owner)
                {
                    return(null);
                }

                switch (thfg.Type)
                {
                case FigureType.Pawn:
                    return(Figurest.CanKillPawnMovement(thfg, cell, thfg.Owner));

                case FigureType.King:
                    return(Figurest.CanKillKingMovement(thfg, cell, thfg.Owner));

                case FigureType.Queen:
                    return(Figurest.CanKillQueenMovement(thfg, cell, pieces));

                case FigureType.Rook:
                    return(Figurest.CanKillRookMovement(thfg, cell, pieces));

                case FigureType.Knight:
                    return(Figurest.CanKillKnightMovement(thfg, cell));

                case FigureType.Bishop:
                    return(Figurest.CanKillBishopMovement(thfg, cell, pieces));
                }
                return(null);
            }
Esempio n. 2
0
            public static List <Pos> CanKillQueenMovement(Figure thfg, Pos cell, IList <Figure> pieces)
            {
                List <Pos> res = Figurest.CanKillRookMovement(thfg, cell, pieces);

                if (res != null)
                {
                    return(res);
                }
                return(Figurest.CanKillBishopMovement(thfg, cell, pieces));
            }