Show / Hide Table of Contents

Interface ITopology

A ITopology specifies a discrete area, volume or graph, and provides generic navigation methods. Topologies are used to support generation in a wide variety of shapes. Topologies do not actually store data, they just specify the dimensions. Actual data is stored in an ITopoArray<T>. Further information can be found in the documentation.

Namespace: DeBroglie.Topo
Assembly: DeBroglie.dll
Syntax
public interface ITopology

Properties

| Edit this page View Source

Depth

The extent along the z-axis.

Declaration
int Depth { get; }
Property Value
Type Description
int
| Edit this page View Source

DirectionsCount

Number of unique directions

Declaration
int DirectionsCount { get; }
Property Value
Type Description
int
| Edit this page View Source

Height

The extent along the y-axis.

Declaration
int Height { get; }
Property Value
Type Description
int
| Edit this page View Source

IndexCount

Number of unique indices (distinct locations) in the topology

Declaration
int IndexCount { get; }
Property Value
Type Description
int
| Edit this page View Source

Mask

A array with one value per index indcating if the value is missing. Not all uses of Topology support masks.

Declaration
bool[] Mask { get; }
Property Value
Type Description
bool[]
| Edit this page View Source

Width

The extent along the x-axis.

Declaration
int Width { get; }
Property Value
Type Description
int

Methods

| Edit this page View Source

GetCoord(int, out int, out int, out int)

Inverts GetIndex(int, int, int)

Declaration
void GetCoord(int index, out int x, out int y, out int z)
Parameters
Type Name Description
int index
int x
int y
int z
| Edit this page View Source

GetIndex(int, int, int)

Reduces a three dimensional co-ordinate to a single integer. This is mostly used internally.

Declaration
int GetIndex(int x, int y, int z)
Parameters
Type Name Description
int x
int y
int z
Returns
Type Description
int
| Edit this page View Source

TryMove(int, Direction, out int)

Given an index and a direction, gives the index that is one step in that direction, if it exists and is not masked out. Otherwise, it returns false.

Declaration
bool TryMove(int index, Direction direction, out int dest)
Parameters
Type Name Description
int index
Direction direction
int dest
Returns
Type Description
bool
| Edit this page View Source

TryMove(int, Direction, out int, out Direction, out EdgeLabel)

Given an index and a direction, gives the index that is one step in that direction, if it exists and is not masked out. Otherwise, it returns false. Additionally returns information about the edge traversed.

Declaration
bool TryMove(int index, Direction direction, out int dest, out Direction inverseDirection, out EdgeLabel edgeLabel)
Parameters
Type Name Description
int index
Direction direction
int dest
Direction inverseDirection
EdgeLabel edgeLabel
Returns
Type Description
bool
| Edit this page View Source

TryMove(int, int, int, Direction, out int)

Given a co-ordinate and a direction, gives the index that is one step in that direction, if it exists and is not masked out. Otherwise, it returns false.

Declaration
bool TryMove(int x, int y, int z, Direction direction, out int dest)
Parameters
Type Name Description
int x
int y
int z
Direction direction
int dest
Returns
Type Description
bool
| Edit this page View Source

TryMove(int, int, int, Direction, out int, out Direction, out EdgeLabel)

Given a co-ordinate and a direction, gives the index that is one step in that direction, if it exists and is not masked out. Otherwise, it returns false. Additionally returns information about the edge traversed.

Declaration
bool TryMove(int x, int y, int z, Direction direction, out int dest, out Direction inverseDirection, out EdgeLabel edgeLabel)
Parameters
Type Name Description
int x
int y
int z
Direction direction
int dest
Direction inverseDirection
EdgeLabel edgeLabel
Returns
Type Description
bool
| Edit this page View Source

TryMove(int, int, int, Direction, out int, out int, out int)

Given a co-ordinate and a direction, gives the co-ordinate that is one step in that direction, if it exists and is not masked out. Otherwise, it returns false.

Declaration
bool TryMove(int x, int y, int z, Direction direction, out int destx, out int desty, out int destz)
Parameters
Type Name Description
int x
int y
int z
Direction direction
int destx
int desty
int destz
Returns
Type Description
bool
| Edit this page View Source

WithMask(bool[])

Returns a topology with the same structure as this one, but with a different mask.

Declaration
ITopology WithMask(bool[] mask)
Parameters
Type Name Description
bool[] mask
Returns
Type Description
ITopology

Extension Methods

TopologyExtensions.AsGridTopology(ITopology)
TopologyExtensions.ContainsIndex(ITopology, int)
TopologyExtensions.GetIndices(ITopology)
  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX