C# Класс Engine.Objects.Layer

A Sphere map layer.
Показать файл Открыть проект Примеры использования класса

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

Метод Описание
AdjustTiles ( short startindex, short delta ) : void

Adjusts the tile indicies for when tiles were removed or added.

CloneTiles ( ) : short[]

Creates a hard copy of the data.

CreateNew ( short width, short height ) : void

Creates a blank layer.

FromBinary ( BinaryReader reader ) : Layer

Creates a proper Sphere from a data stream.

GetTile ( int x, int y ) : short

Gets tile index at the (x, y) position.

Layer ( ) : System

Constructs a new Sphere layer.

ReplaceTiles ( short from, short to ) : void

Replaces all the tile indices on this layer from 'from' to 'to'.

Resize ( short width, short height ) : void

Resizes the field to the new size.

Save ( BinaryWriter writer ) : void

Writes data to the binary writer.

SetTile ( int x, int y, short index ) : bool

Sets a tile, if applicable.

SetTiles ( short tiles ) : void

Pump in a 2D array to replace current tiles with.

Validate ( int max ) : bool

Checks to see if the layer has correct tile indicies. Will set afflicted tiles to 0, if check fails.

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

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

Adjusts the tile indicies for when tiles were removed or added.
public AdjustTiles ( short startindex, short delta ) : void
startindex short Index to start at.
delta short How much of a shift to make.
Результат void

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

Creates a hard copy of the data.
public CloneTiles ( ) : short[]
Результат short[]

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

Creates a blank layer.
public CreateNew ( short width, short height ) : void
width short Width in tiles to use.
height short Height in tiles to use.
Результат void

FromBinary() публичный статический Метод

Creates a proper Sphere from a data stream.
public static FromBinary ( BinaryReader reader ) : Layer
reader System.IO.BinaryReader BinaryReader to use.
Результат Layer

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

Gets tile index at the (x, y) position.
public GetTile ( int x, int y ) : short
x int X-coord of tile.
y int Y-coord of tile.
Результат short

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

Constructs a new Sphere layer.
public Layer ( ) : System
Результат System

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

Replaces all the tile indices on this layer from 'from' to 'to'.
public ReplaceTiles ( short from, short to ) : void
from short The old index to replace.
to short The new index to replace with.
Результат void

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

Resizes the field to the new size.
public Resize ( short width, short height ) : void
width short New width of the field.
height short New height of the field.
Результат void

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

Writes data to the binary writer.
public Save ( BinaryWriter writer ) : void
writer System.IO.BinaryWriter BinaryWriter to use.
Результат void

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

Sets a tile, if applicable.
public SetTile ( int x, int y, short index ) : bool
x int X-coord to use.
y int Y-coord to use.
index short Index to set to.
Результат bool

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

Pump in a 2D array to replace current tiles with.
public SetTiles ( short tiles ) : void
tiles short New array of tile indicies to use.
Результат void

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

Checks to see if the layer has correct tile indicies. Will set afflicted tiles to 0, if check fails.
public Validate ( int max ) : bool
max int The maximum tile index expected.
Результат bool