Map
Namespace: Murder.Core
Assembly: Murder.dll
public class Map
⭐ Constructors
public Map(int width, int height)
Parameters
width
int
height
int
⭐ Properties
Height
public readonly int Height;
Returns
int
Width
public readonly int Width;
Returns
int
⭐ Methods
HasCollision(int, int, int)
public bool HasCollision(int x, int y, int layer)
Parameters
x
int
y
int
layer
int
Returns
bool
HasCollision(int, int, int, int, int)
public bool HasCollision(int x, int y, int width, int height, int mask)
Parameters
x
int
y
int
width
int
height
int
mask
int
Returns
bool
HasLineOfSight(Point, Point, bool, int)
public bool HasLineOfSight(Point start, Point end, bool excludeEdges, int blocking)
A fast Line of Sight check It is not exact by any means, just tries to draw A line of tiles between start and end.
Parameters
start
Point
end
Point
excludeEdges
bool
blocking
int
Returns
bool
IsInsideGrid(int, int)
public bool IsInsideGrid(int x, int y)
Returns
bool
IsObstacle(Point)
public bool IsObstacle(Point p)
Parameters
p
Point
Returns
bool
IsObstacleOrBlockVision(Point)
public bool IsObstacleOrBlockVision(Point p)
Parameters
p
Point
Returns
bool
GetStaticCollisions(IntRectangle)
public IEnumerable<T> GetStaticCollisions(IntRectangle rect)
Parameters
rect
IntRectangle
Returns
IEnumerable<T>
FloorAt(Point)
public int FloorAt(Point p)
Parameters
p
Point
Returns
int
GetCollision(int, int)
public int GetCollision(int x, int y)
Returns
int
WeightAt(Point)
public int WeightAt(Point p)
Parameters
p
Point
Returns
int
WeightAt(int, int)
public int WeightAt(int x, int y)
Returns
int
GetGridMap(int, int)
public MapTile GetGridMap(int x, int y)
Returns
MapTile
HasCollisionAt(IntRectangle, int)
public T? HasCollisionAt(IntRectangle rect, int mask)
Parameters
rect
IntRectangle
mask
int
Returns
T?
HasCollisionAt(int, int, int, int, int)
public T? HasCollisionAt(int x, int y, int width, int height, int mask)
Check for collision using tiles coordinates.
Parameters
x
int
y
int
width
int
height
int
mask
int
Returns
T?
OverrideValueAt(Point, int, int)
public void OverrideValueAt(Point p, int collisionMask, int weight)
Parameters
p
Point
collisionMask
int
weight
int
SetFloorAt(IntRectangle, int)
public void SetFloorAt(IntRectangle rect, int type)
Parameters
rect
IntRectangle
type
int
SetFloorAt(int, int, int)
public void SetFloorAt(int x, int y, int type)
Parameters
x
int
y
int
type
int
SetOccupied(Point, int, int)
public void SetOccupied(Point p, int collisionMask, int weight)
Parameters
p
Point
collisionMask
int
weight
int
SetOccupiedAsCarve(IntRectangle, bool, bool, bool, int)
public void SetOccupiedAsCarve(IntRectangle rect, bool blockVision, bool isObstacle, bool isClearPath, int weight)
Parameters
rect
IntRectangle
blockVision
bool
isObstacle
bool
isClearPath
bool
weight
int
SetOccupiedAsStatic(int, int, int)
public void SetOccupiedAsStatic(int x, int y, int layer)
Parameters
x
int
y
int
layer
int
SetUnoccupied(Point, int, int)
public void SetUnoccupied(Point p, int collisionMask, int weight)
Parameters
p
Point
collisionMask
int
weight
int
SetUnoccupiedCarve(IntRectangle, bool, bool, int)
public void SetUnoccupiedCarve(IntRectangle rect, bool blockVision, bool isObstacle, int weight)
Parameters
rect
IntRectangle
blockVision
bool
isObstacle
bool
weight
int
ZeroAll()
public void ZeroAll()
⚡