Dungeon Architect  17.0.0
SharpNav.HeightPatch Class Reference

Stores height data in a grid. More...

Public Member Functions

 HeightPatch (int x, int y, int width, int length)
 Initializes a new instance of the HeightPatch class. More...
 
bool IsSet (int index)
 Checks an index to see whether or not it's height value has been set. More...
 
bool TryGetHeight (int index, out int value)
 Gets the height value at a specified index. A return value indicates whether the height value is set. More...
 
bool TryGetHeight (int x, int y, out int value)
 Gets the height value at a specified index. A return value indicates whether the height value is set. More...
 
void Resize (int x, int y, int width, int length)
 Resizes the patch. Only works if the new size is smaller than or equal to the initial size. More...
 
void Clear ()
 Clears the HeightPatch by unsetting every value. More...
 
void SetAll (int h)
 Sets all of the height values to the same value. More...
 

Static Public Attributes

const int UnsetHeight = -1
 The value used when a height value has not yet been set. More...
 

Properties

int X [get]
 Gets the X coordinate of the patch. More...
 
int Y [get]
 Gets the Y coordinate of the patch. More...
 
int Width [get]
 Gets the width of the patch. More...
 
int Length [get]
 Gets the length of the patch. More...
 
int this[int index] [get, set]
 Gets or sets the height at a specified index. More...
 
int this[int x, int y] [get, set]
 Gets or sets the height at a specified coordinate (x, y). More...
 

Detailed Description

Stores height data in a grid.

Definition at line 11 of file HeightPatch.cs.

Constructor & Destructor Documentation

◆ HeightPatch()

SharpNav.HeightPatch.HeightPatch ( int  x,
int  y,
int  width,
int  length 
)

Initializes a new instance of the HeightPatch class.

Parameters
xThe initial X coordinate of the patch.
yThe initial Y coordinate of the patch.
widthThe width of the patch.
lengthThe length of the patch.

Definition at line 28 of file HeightPatch.cs.

Member Function Documentation

◆ Clear()

void SharpNav.HeightPatch.Clear ( )

Clears the HeightPatch by unsetting every value.

Definition at line 179 of file HeightPatch.cs.

◆ IsSet()

bool SharpNav.HeightPatch.IsSet ( int  index)

Checks an index to see whether or not it's height value has been set.

Parameters
indexThe index to check.
Returns
A value indicating whether or not the height value at the index is set.

Definition at line 128 of file HeightPatch.cs.

◆ Resize()

void SharpNav.HeightPatch.Resize ( int  x,
int  y,
int  width,
int  length 
)

Resizes the patch. Only works if the new size is smaller than or equal to the initial size.

Parameters
xThe new X coordinate.
yThe new Y coordinate.
widthThe new width.
lengthThe new length.

Definition at line 165 of file HeightPatch.cs.

◆ SetAll()

void SharpNav.HeightPatch.SetAll ( int  h)

Sets all of the height values to the same value.

Parameters
hThe height to apply to all values.

Definition at line 189 of file HeightPatch.cs.

◆ TryGetHeight() [1/2]

bool SharpNav.HeightPatch.TryGetHeight ( int  index,
out int  value 
)

Gets the height value at a specified index. A return value indicates whether the height value is set.

Parameters
indexThe index to use.
valueContains the height at the value.
Returns
A value indicating whether the value at the specified index is set.

Definition at line 139 of file HeightPatch.cs.

◆ TryGetHeight() [2/2]

bool SharpNav.HeightPatch.TryGetHeight ( int  x,
int  y,
out int  value 
)

Gets the height value at a specified index. A return value indicates whether the height value is set.

Parameters
xThe X coordinate.
yThe Y coordinate.
valueContains the height at the value.
Returns
A value indicating whether the value at the specified index is set.

Definition at line 152 of file HeightPatch.cs.

Member Data Documentation

◆ UnsetHeight

const int SharpNav.HeightPatch.UnsetHeight = -1
static

The value used when a height value has not yet been set.

Definition at line 16 of file HeightPatch.cs.

Property Documentation

◆ Length

int SharpNav.HeightPatch.Length
get

Gets the length of the patch.

Definition at line 78 of file HeightPatch.cs.

◆ this[int index]

int SharpNav.HeightPatch.this[int index]
getset

Gets or sets the height at a specified index.

Parameters
indexThe index inside the patch.
Returns
The height at the specified index.

Definition at line 91 of file HeightPatch.cs.

◆ this[int x, int y]

int SharpNav.HeightPatch.this[int x, int y]
getset

Gets or sets the height at a specified coordinate (x, y).

Parameters
xThe X coordinate.
yThe Y coordinate.
Returns
The height at the specified index.

Definition at line 110 of file HeightPatch.cs.

◆ Width

int SharpNav.HeightPatch.Width
get

Gets the width of the patch.

Definition at line 67 of file HeightPatch.cs.

◆ X

int SharpNav.HeightPatch.X
get

Gets the X coordinate of the patch.

Definition at line 45 of file HeightPatch.cs.

◆ Y

int SharpNav.HeightPatch.Y
get

Gets the Y coordinate of the patch.

Definition at line 56 of file HeightPatch.cs.


The documentation for this class was generated from the following file: