Exemple #1
0
 public IEnumerable <ChessMove> GetPossibleMoves(ChessboardPosition currentPosition)
 {
     return(pieceAllowedMoves.GetPossibleMoves(currentPosition));
 }
Exemple #2
0
 public bool IsMoveAllowed(ChessboardPosition currentPosition, ChessboardPosition targetPosition)
 {
     return(GetPossibleMoves(currentPosition).Any(move => move.To.Equals(targetPosition)));
 }
Exemple #3
0
        // TODO Consider creating a base class for value types with compare by value semantics.
        #region Equals & GetHashCode

        protected bool Equals(ChessboardPosition other)
        {
            return(X == other.X && Y == other.Y);
        }