示例#1
0
        public bool IsCheckFor(Board board, ChessColor color)
        {
            var kingLocation = board.GetKingLocation(color);

            var opponentColor           = color.GetOpposite();
            var opponentPiecesLocations = board.GetPiecesLocations(opponentColor);

            var kingCanBeTakeByOpponentPiece = opponentPiecesLocations
                                               .Any(pieceLoc => CanPieceTakeAtLocation(board, pieceLoc.Location, kingLocation));

            return(kingCanBeTakeByOpponentPiece);
        }
示例#2
0
 public void SwitchViewPerspective()
 {
     viewPerspective = viewPerspective.GetOpposite();
 }