/// <summary> /// Initializes a new instance of the <see cref="Move"/> class. /// </summary> /// <param name="turnNo"> /// The turn no. /// </param> /// <param name="lastMoveTurnNo"> /// The last move turn no. /// </param> /// <param name="moveName"> /// The move name. /// </param> /// <param name="piece"> /// The piece moving. /// </param> /// <param name="from"> /// The square the peice is moving from. /// </param> /// <param name="to"> /// The square the peice is moving to. /// </param> /// <param name="pieceCaptured"> /// The piece being captured. /// </param> /// <param name="pieceCapturedOrdinal"> /// Ordinal position of the piece being captured. /// </param> /// <param name="score"> /// The positional score. /// </param> public Move(int turnNo, int lastMoveTurnNo, MoveNames moveName, Piece piece, Square from, Square to, Piece pieceCaptured, int pieceCapturedOrdinal, int score) { this.EnemyStatus = Player.PlayerStatusNames.Normal; this.TurnNo = turnNo; this.LastMoveTurnNo = lastMoveTurnNo; this.Name = moveName; this.Piece = piece; this.From = from; this.To = to; this.PieceCaptured = pieceCaptured; this.PieceCapturedOrdinal = pieceCapturedOrdinal; this.Score = score; if (moveName != MoveNames.NullMove && pieceCaptured == null && piece != null && piece.Name != Piece.PieceNames.Pawn) { this.FiftyMoveDrawCounter = Game.MoveHistory.Count > 0 ? Game.MoveHistory.Last.FiftyMoveDrawCounter + 1 : (Game.FiftyMoveDrawBase / 2) + 1; } }
public Move(MoveNames move) { this.moveType = move; }