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); }
private ChessPieceEntity CreatePawn(Colours colour) => _entityFactory.Create(new ChessPieceEntityFactory.ChessPieceEntityFactoryTypeExtraData { Owner = colour, PieceName = ChessPieceName.Pawn });