C# Класс TileGenerator.TileManager

Stores and manages the tiles
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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

Приватные методы

Метод Описание
IsInBounds ( int x, int y ) : bool

Check if grid cell is in bounds

Описание методов

AddTile() публичный Метод

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
Результат void

GetAllTiles() публичный Метод

Get a 2D array of all tiles
public GetAllTiles ( ) : ].bool[
Результат ].bool[

GetTile() публичный Метод

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
Результат bool

GetTileRectangle() публичный Метод

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
Результат Microsoft.Xna.Framework.Rectangle

RemoveTile() публичный Метод

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
Результат void

TileManager() публичный Метод

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)
Результат System

TileManager() публичный Метод

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)
Результат System