Exemple #1
0
        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);
        }
Exemple #2
0
 public Pawn(BoardCoordinate initialCoordinate, ChessPieceColor owningPlayerOrientation) : base(initialCoordinate, owningPlayerOrientation)
 {
     this._allowedMoves = new List <ChessPieceMoveDefinition>();
     this._allowedMoves.Add(StandardMoveDefinitions.PawnInitialMoveDefinition(this.OwningPlayerOrientation));
 }