Ejemplo n.º 1
0
        public void TryMove(Direction direction)
        {
            Direction.Value = direction;

            var emptyTiles   = _gridModel.GetEmptyTiles();
            var nextPosition = Position.Value + direction.ToVector();

            if (emptyTiles.Any(tile => tile.Position == nextPosition))
            {
                Position.Value += direction.ToVector();
            }
        }