public override bool MoveTo(BoardCoordinate coordinate) { bool isFirstMove = this.CurrentLocation == this.MoveHistory[0]; bool hasMoved = base.MoveTo(coordinate); if (isFirstMove && hasMoved) { this._allowedMoves.Remove(StandardMoveDefinitions.PawnInitialMoveDefinition(this.OwningPlayerOrientation)); this._allowedMoves.Add(StandardMoveDefinitions.PawnStandardMoveDefinition(this.OwningPlayerOrientation)); } return(hasMoved); }
public Pawn(BoardCoordinate initialCoordinate, ChessPieceColor owningPlayerOrientation) : base(initialCoordinate, owningPlayerOrientation) { this._allowedMoves = new List <ChessPieceMoveDefinition>(); this._allowedMoves.Add(StandardMoveDefinitions.PawnInitialMoveDefinition(this.OwningPlayerOrientation)); }