Example #1
0
        public override void Execute(BoardMove move)
        {
            if (BoardState.IsEmpty(move.From))
            {
                return;
            }

//            var piece = BoardState.GetItem(move.From).Item;

            BoardState.Remove(move.From);

            if (!BoardState.IsEmpty(move.To))
            {
                BoardState.Remove(move.To);
            }

            var chessPieceEntity = _entityFactory.Create(move.ExtraData);

            BoardState.PlaceEntity(move.To, chessPieceEntity);
            chessPieceEntity.AddMoveTo(move.To);
        }
Example #2
0
 private ChessPieceEntity CreatePawn(Colours colour) =>
 _entityFactory.Create(new ChessPieceEntityFactory.ChessPieceEntityFactoryTypeExtraData
 {
     Owner     = colour,
     PieceName = ChessPieceName.Pawn
 });