C# 클래스 Engine.Objects.Layer

A Sphere map layer.
파일 보기 프로젝트 열기: Radnen/sphere-sfml 1 사용 예제들

공개 메소드들

메소드 설명
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