C# Class TileGenerator.TileManager

Stores and manages the tiles
Afficher le fichier Open project: Jewelots/Spelunky-Tiles Class Usage Examples

Méthodes publiques

Méthode Description
AddTile ( int x, int y ) : void

Add a tile to a cell

GetAllTiles ( ) : ].bool[

Get a 2D array of all tiles

GetTile ( int x, int y ) : bool

Get the state of a cell

GetTileRectangle ( int x, int y ) : Rectangle

Get a rectangle encompassing a tile

RemoveTile ( int x, int y ) : void

Remove a tile from a cell

TileManager ( float width, float height, int tileSize ) : System

Create a new tile Manager

TileManager ( int width, int height, int tileSize ) : System

Create a new tile manager

Private Methods

Méthode Description
IsInBounds ( int x, int y ) : bool

Check if grid cell is in bounds

Method Details

AddTile() public méthode

Add a tile to a cell
public AddTile ( int x, int y ) : void
x int X position of cell
y int Y position of cell
Résultat void

GetAllTiles() public méthode

Get a 2D array of all tiles
public GetAllTiles ( ) : ].bool[
Résultat ].bool[

GetTile() public méthode

Get the state of a cell
public GetTile ( int x, int y ) : bool
x int X position of cell
y int Y position of cell
Résultat bool

GetTileRectangle() public méthode

Get a rectangle encompassing a tile
public GetTileRectangle ( int x, int y ) : Rectangle
x int X position of cell
y int Y position of cell
Résultat Microsoft.Xna.Framework.Rectangle

RemoveTile() public méthode

Remove a tile from a cell
public RemoveTile ( int x, int y ) : void
x int X position of cell
y int Y position of cell
Résultat void

TileManager() public méthode

Create a new tile Manager
public TileManager ( float width, float height, int tileSize ) : System
width float Width of the grid (tiles, rounds up)
height float Height of the grid (tiles, rounds up)
tileSize int Size of each tile (pixels)
Résultat System

TileManager() public méthode

Create a new tile manager
public TileManager ( int width, int height, int tileSize ) : System
width int Width of the grid (tiles)
height int Height of the grid (tiles)
tileSize int Size of each tile (pixels)
Résultat System