Exemplo n.º 1
0
        /*********
        ** 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));
        }
Exemplo n.º 2
0
 /****
 ** 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));
 }
Exemplo n.º 3
0
 /****
 ** 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()));
 }
Exemplo n.º 4
0
 /// <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());
 }
Exemplo n.º 5
0
 /// <summary>Get all tiles which are on-screen.</summary>
 public static IEnumerable <Vector2> GetVisibleTiles()
 {
     return(TileHelper.GetVisibleArea().GetTiles());
 }
Exemplo n.º 6
0
        /*********
        ** 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));
        }