/********* ** Public methods *********/ /**** ** Location ****/ /// <summary>Get the tile coordinates in the game location.</summary> /// <param name="location">The game location to search.</param> public static IEnumerable <Vector2> GetTiles(this GameLocation?location) { if (location?.Map?.Layers == null) { return(Enumerable.Empty <Vector2>()); } Layer layer = location.Map.Layers[0]; return(TileHelper.GetTiles(0, 0, layer.LayerWidth, layer.LayerHeight)); }
/**** ** Rectangle ****/ /// <summary>Get the tile coordinates in the tile area.</summary> /// <param name="area">The tile area to search.</param> public static IEnumerable <Vector2> GetTiles(this Rectangle area) { return(TileHelper.GetTiles(area.X, area.Y, area.Width, area.Height)); }
/**** ** Cursor ****/ /// <summary>Get the tile under the player's cursor (not restricted to the player's grab tile range).</summary> public static Vector2 GetTileFromCursor() { return(TileHelper.GetTileFromScreenPosition(Game1.getMouseX(), Game1.getMouseY())); }
/// <summary>Get all tiles which are on-screen.</summary> /// <param name="expand">The number of tiles to expand in each direction, to avoid tile edge pop-in.</param> public static IEnumerable <Vector2> GetVisibleTiles(int expand = 0) { return(TileHelper.GetVisibleArea(expand).GetTiles()); }
/// <summary>Get all tiles which are on-screen.</summary> public static IEnumerable <Vector2> GetVisibleTiles() { return(TileHelper.GetVisibleArea().GetTiles()); }
/********* ** Public methods *********/ /**** ** Location ****/ /// <summary>Get the tile coordinates in the game location.</summary> /// <param name="location">The game location to search.</param> public static IEnumerable <Vector2> GetTiles(this GameLocation location) { Layer layer = location.Map.Layers[0]; return(TileHelper.GetTiles(0, 0, layer.LayerWidth, layer.LayerHeight)); }