public override int GetHashCode()
 {
     unchecked
     {
         int hashCode = Owner.GetHashCode();
         hashCode = (hashCode * 397) ^ (From != null ? From.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (To != null ? To.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ PromoteTo.GetHashCode();
         return(hashCode);
     }
 }
Example #2
0
        internal Piece CreatePiece(PromoteTo promoteTo, Color color)
        {
            switch (promoteTo)
            {
            case PromoteTo.Bishop:
                return(new Bishop(color));

            case PromoteTo.Knight:
                return(new Knight(color));

            case PromoteTo.Queen:
                return(new Queen(color));

            case PromoteTo.Rook:
                return(new Rook(color));

            default:
                throw new NotImplementedException();
            }
        }
Example #3
0
 public void ProvideRequestedPiece(PromoteTo promoteTo)
 {
     _infoAsker.ProvideRequestedInfo(promoteTo);
 }