Struct GraphMask

Public

A combination of graphs.

Represents a set of graphs, which is usually used to filter which graphs to use for pathfinding, or which graphs to apply an update to.

This mask can hold any subset of small graph indices (up to graph index 30), but only a combination of at most 3 graphs of large graph indices (larger than 30). Almost all games will use only one or a few graphs, so you can think of this as being able to represent any combination of graphs.

GraphMask mask1 = GraphMask.FromGraphName("My Grid Graph");
GraphMask mask2 = GraphMask.FromGraphName("My Other Grid Graph");

NearestNodeConstraint nn = NearestNodeConstraint.Walkable;

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);

Public Methods

Contains (...)

True if this mask contains the g...

Equals (obj)
GraphMask (value)

Public Static Methods

FromGraph (graph)

A bitmask containing the given graph.

FromGraphIndex (graphIndex)

A bitmask containing the given graph index.

FromGraphName (graphName)

A bitmask containing the first graph with the given name.

InsertMask (indices, cnt, mask)
InsertSorted (indices, cnt, value)

Insert one item, as part of an insertion-sort.

operator!= (lhs, rhs)
operator== (lhs, rhs)
operator| (lhs, rhs)

Combines two masks to form the union of them.

operator~ (lhs)

Inverts the mask.

Public Variables

containsAllGraphs

True if the mask contains all graphs, i.e.

Public
isPureBitmask
Public

Public Static Variables

Everything
Public Static
InvertedBit
Public Static
LargeGraphIndicesBit
Public Static
RemainingGraphIndicesBit
Public Static
SmallestLargeGraphIndex
Public Static
everything

A mask containing every graph.

Public Static

Private/Protected Members

value

Internal representation of the mask.

Private