Dungeon Architect  17.0.0
SharpNav.Region Class Reference

A Region contains a group of adjacent spans. More...

Public Member Functions

 Region (int idNum)
 Initializes a new instance of the Region class. More...
 
void RemoveAdjacentNeighbours ()
 Remove adjacent connections if there is a duplicate More...
 
void ReplaceNeighbour (RegionId oldId, RegionId newId)
 Replace all connection and floor values More...
 
bool CanMergeWith (Region otherRegion)
 Determine whether this region can merge with another region. More...
 
void AddUniqueFloorRegion (RegionId n)
 Only add a floor if it hasn't been added already More...
 
bool MergeWithRegion (Region otherRegion)
 Merge two regions into one. Needs good testing More...
 
bool IsConnectedToBorder ()
 Test if region is connected to a border More...
 

Properties

int SpanCount [get, set]
 Gets or sets the number of spans More...
 
RegionId Id [get, set]
 Gets or sets the region id More...
 
Area AreaType [get, set]
 Gets or sets the AreaType of this region More...
 
bool Remap [get, set]
 Gets or sets a value indicating whether this region has been remapped or not More...
 
bool Visited [get, set]
 Gets or sets a value indicating whether this region has been visited or not More...
 
List< RegionIdFloorRegions [get]
 Gets the list of floor regions More...
 
List< RegionIdConnections [get]
 Gets the list of connected regions More...
 
bool IsBorder [get]
 Gets a value indicating whether the region is a border region. More...
 
bool IsBorderOrNull [get]
 Gets a value indicating whether the region is either a border region or the null region. More...
 

Detailed Description

A Region contains a group of adjacent spans.

Definition at line 352 of file Region.cs.

Constructor & Destructor Documentation

◆ Region()

SharpNav.Region.Region ( int  idNum)

Initializes a new instance of the Region class.

Parameters
idNumThe id

Definition at line 366 of file Region.cs.

Member Function Documentation

◆ AddUniqueFloorRegion()

void SharpNav.Region.AddUniqueFloorRegion ( RegionId  n)

Only add a floor if it hasn't been added already

Parameters
nThe value of the floor

Definition at line 589 of file Region.cs.

◆ CanMergeWith()

bool SharpNav.Region.CanMergeWith ( Region  otherRegion)

Determine whether this region can merge with another region.

Parameters
otherRegionThe other region to merge with
Returns
True if the two regions can be merged, false if otherwise

Definition at line 560 of file Region.cs.

◆ IsConnectedToBorder()

bool SharpNav.Region.IsConnectedToBorder ( )

Test if region is connected to a border

Returns
True if connected, false if not

Definition at line 662 of file Region.cs.

◆ MergeWithRegion()

bool SharpNav.Region.MergeWithRegion ( Region  otherRegion)

Merge two regions into one. Needs good testing

Parameters
otherRegionThe region to merge with
Returns
True if merged successfully, false if otherwise

Definition at line 600 of file Region.cs.

◆ RemoveAdjacentNeighbours()

void SharpNav.Region.RemoveAdjacentNeighbours ( )

Remove adjacent connections if there is a duplicate

Definition at line 505 of file Region.cs.

◆ ReplaceNeighbour()

void SharpNav.Region.ReplaceNeighbour ( RegionId  oldId,
RegionId  newId 
)

Replace all connection and floor values

Parameters
oldIdThe value you want to replace
newIdThe new value that will be used

Definition at line 530 of file Region.cs.

Property Documentation

◆ AreaType

Area SharpNav.Region.AreaType
getset

Gets or sets the AreaType of this region

Definition at line 413 of file Region.cs.

◆ Connections

List<RegionId> SharpNav.Region.Connections
get

Gets the list of connected regions

Definition at line 472 of file Region.cs.

◆ FloorRegions

List<RegionId> SharpNav.Region.FloorRegions
get

Gets the list of floor regions

Definition at line 461 of file Region.cs.

◆ Id

RegionId SharpNav.Region.Id
getset

Gets or sets the region id

Definition at line 397 of file Region.cs.

◆ IsBorder

bool SharpNav.Region.IsBorder
get

Gets a value indicating whether the region is a border region.

Definition at line 483 of file Region.cs.

◆ IsBorderOrNull

bool SharpNav.Region.IsBorderOrNull
get

Gets a value indicating whether the region is either a border region or the null region.

Definition at line 494 of file Region.cs.

◆ Remap

bool SharpNav.Region.Remap
getset

Gets or sets a value indicating whether this region has been remapped or not

Definition at line 429 of file Region.cs.

◆ SpanCount

int SharpNav.Region.SpanCount
getset

Gets or sets the number of spans

Definition at line 381 of file Region.cs.

◆ Visited

bool SharpNav.Region.Visited
getset

Gets or sets a value indicating whether this region has been visited or not

Definition at line 445 of file Region.cs.


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