A* Pathfinding Project  4.1.24
The A* Pathfinding Project for Unity 3D
GraphMask Struct Reference

Holds a bitmask of graphs. More...

Detailed Description

Holds a bitmask of graphs.

This bitmask can hold up to 32 graphs.

The bitmask can be converted to and from integers implicitly.

GraphMask mask1 = GraphMask.FromGraphName("My Grid Graph");
GraphMask mask2 = GraphMask.FromGraphName("My Other Grid Graph");
NNConstraint nn = NNConstraint.Default;
nn.graphMask = mask1 | mask2;
// Find the node closest to somePoint which is either in 'My Grid Graph' OR in 'My Other Grid Graph'
var info = AstarPath.active.GetNearest(somePoint, nn);
See also
Bitmask Tutorial

Public Member Functions

 GraphMask (int value)
 
bool Contains (int graphIndex)
 True if this mask contains the graph with the given graph index. More...
 
override string ToString ()
 

Static Public Member Functions

static GraphMask FromGraph (NavGraph graph)
 A bitmask containing the given graph. More...
 
static GraphMask FromGraphName (string graphName)
 A bitmask containing the first graph with the given name. More...
 
static implicit operator GraphMask (int mask)
 
static implicit operator int (GraphMask mask)
 
static GraphMask operator& (GraphMask lhs, GraphMask rhs)
 Combines two masks to form the intersection between them. More...
 
static GraphMask operator| (GraphMask lhs, GraphMask rhs)
 Combines two masks to form the union of them. More...
 
static GraphMask operator~ (GraphMask lhs)
 Inverts the mask. More...
 

Public Attributes

int value
 Bitmask representing the mask. More...
 

Properties

static GraphMask everything [get]
 A mask containing every graph. More...
 

Constructor & Destructor Documentation

◆ GraphMask()

GraphMask ( int  value)

Member Function Documentation

◆ Contains()

bool Contains ( int  graphIndex)

True if this mask contains the graph with the given graph index.

◆ FromGraph()

static GraphMask FromGraph ( NavGraph  graph)
static

A bitmask containing the given graph.

◆ FromGraphName()

static GraphMask FromGraphName ( string  graphName)
static

A bitmask containing the first graph with the given name.

GraphMask mask1 = GraphMask.FromGraphName("My Grid Graph");
GraphMask mask2 = GraphMask.FromGraphName("My Other Grid Graph");
NNConstraint nn = NNConstraint.Default;
nn.graphMask = mask1 | mask2;
// Find the node closest to somePoint which is either in 'My Grid Graph' OR in 'My Other Grid Graph'
var info = AstarPath.active.GetNearest(somePoint, nn);

◆ operator GraphMask()

static implicit operator GraphMask ( int  mask)
static

◆ operator int()

static implicit operator int ( GraphMask  mask)
static

◆ operator&()

static GraphMask operator & ( GraphMask  lhs,
GraphMask  rhs 
)
static

Combines two masks to form the intersection between them.

◆ operator|()

static GraphMask operator| ( GraphMask  lhs,
GraphMask  rhs 
)
static

Combines two masks to form the union of them.

◆ operator~()

static GraphMask operator~ ( GraphMask  lhs)
static

Inverts the mask.

◆ ToString()

override string ToString ( )

Member Data Documentation

◆ value

int value

Bitmask representing the mask.

Property Documentation

◆ everything

GraphMask everything
staticget

A mask containing every graph.


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