C# Class TileGenerator.TileManager

Stores and manages the tiles
ファイルを表示 Open project: Jewelots/Spelunky-Tiles Class Usage Examples

Public Methods

Method 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

Method Description
IsInBounds ( int x, int y ) : bool

Check if grid cell is in bounds

Method Details

AddTile() public method

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
return void

GetAllTiles() public method

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

GetTile() public method

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
return bool

GetTileRectangle() public method

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
return Microsoft.Xna.Framework.Rectangle

RemoveTile() public method

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
return void

TileManager() public method

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)
return System

TileManager() public method

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)
return System