TileGrid

Namespace: Murder.Core
Assembly: Murder.dll

public class TileGrid

⭐ Constructors

public TileGrid(Point origin, int width, int height)

Parameters
origin Point
width int
height int

⭐ Properties

Height

public int Height { get; }

Returns
int

Origin

public Point Origin { get; }

Returns
Point

Width

public int Width { get; }

Returns
int

⭐ Methods

HasFlagAtGridPosition(int, int, int)

public bool HasFlagAtGridPosition(int x, int y, int value)

Checks whether is solid at a position and . This will take a position from the grid (world) back to the local grid, using TileGrid.Origin.

Parameters
x int
y int
value int

Returns
bool

At(Point)

public int At(Point p)

Parameters
p Point

Returns
int

At(int, int)

public int At(int x, int y)

Parameters
x int
y int

Returns
int

AtGridPosition(Point)

public int AtGridPosition(Point p)

Parameters
p Point

Returns
int

GetTile(ImmutableArray, int, int, int, int)

public ValueTuple<T1, T2, T3> GetTile(ImmutableArray<T> tileEntities, int index, int totalTilemaps, int x, int y)

Parameters
tileEntities ImmutableArray<T>
index int
totalTilemaps int
x int
y int

Returns
ValueTuple<T1, T2, T3>

HasFlagAt(int, int, int)

public virtual bool HasFlagAt(int x, int y, int value)

Parameters
x int
y int
value int

Returns
bool

MoveFromTo(Point, Point, Point)

public void MoveFromTo(Point from, Point to, Point size)

Parameters
from Point
to Point
size Point

Resize(IntRectangle)

public void Resize(IntRectangle rectangle)

This supports resize the grid up to: _____ ______ | | -> | | |x | | |_x or _____ _____ | x | -> | x | || ||

        Where x is the bullet point.

Parameters
rectangle IntRectangle

Resize(int, int, Point)

public void Resize(int width, int height, Point origin)

Parameters
width int
height int
origin Point

Set(Point, int, bool)

public void Set(Point p, int value, bool overridePreviousValues)

Parameters
p Point
value int
overridePreviousValues bool

Set(int, int, int, bool)

public void Set(int x, int y, int value, bool overridePreviousValues)

Parameters
x int
y int
value int
overridePreviousValues bool

SetGridPosition(IntRectangle, int)

public void SetGridPosition(IntRectangle rect, int value)

Parameters
rect IntRectangle
value int

SetGridPosition(Point, int)

public void SetGridPosition(Point p, int value)

Parameters
p Point
value int

Unset(Point, int)

public void Unset(Point p, int value)

Parameters
p Point
value int

Unset(int, int, int)

public void Unset(int x, int y, int value)

Parameters
x int
y int
value int

UnsetAll(int)

public void UnsetAll(int value)

Unset all the tiles according to the bitness of .

Parameters
value int

UnsetGridPosition(IntRectangle, int)

public void UnsetGridPosition(IntRectangle rect, int value)

Parameters
rect IntRectangle
value int

UnsetGridPosition(Point, int)

public void UnsetGridPosition(Point p, int value)

Parameters
p Point
value int

UpdateCache(ImmutableArray)

public void UpdateCache(ImmutableArray<T> tileEntities)

Parameters
tileEntities ImmutableArray<T>