A* Pathfinding Project  4.1.24
The A* Pathfinding Project for Unity 3D
BlockManager Class Reference

Manager for blocker scripts such as SingleNodeBlocker. More...

Detailed Description

Manager for blocker scripts such as SingleNodeBlocker.

This is part of the turn based utilities. It can be used for any game, but it is primarily intended for turn based games.

See also
TurnBasedAI
Utilities for turn-based games

Classes

class  TraversalProvider
 Blocks nodes according to a BlockManager. More...
 

Public Types

enum  BlockMode { AllExceptSelector, OnlySelector }
 

Public Member Functions

void InternalBlock (GraphNode node, SingleNodeBlocker blocker)
 Register blocker as being present at the specified node. More...
 
void InternalUnblock (GraphNode node, SingleNodeBlocker blocker)
 Remove blocker from the specified node. More...
 
bool NodeContainsAnyExcept (GraphNode node, List< SingleNodeBlocker > selector)
 True if the node contains any blocker which is not included in the selector list. More...
 
bool NodeContainsAnyOf (GraphNode node, List< SingleNodeBlocker > selector)
 True if the node contains any blocker which is included in the selector list. More...
 

Private Member Functions

void Start ()
 

Private Attributes

Dictionary< GraphNode, List< SingleNodeBlocker > > blocked = new Dictionary<GraphNode, List<SingleNodeBlocker> >()
 Contains info on which SingleNodeBlocker objects have blocked a particular node. More...
 

Additional Inherited Members

- Protected Member Functions inherited from VersionedMonoBehaviour
virtual void Awake ()
 
virtual int OnUpgradeSerializedData (int version, bool unityThread)
 Handle serialization backwards compatibility. More...
 
virtual void Reset ()
 Handle serialization backwards compatibility. More...
 

Member Enumeration Documentation

◆ BlockMode

enum BlockMode
strong
Enumerator
AllExceptSelector 

All blockers except those in the TraversalProvider.selector list will block.

OnlySelector 

Only elements in the TraversalProvider.selector list will block.

Member Function Documentation

◆ InternalBlock()

void InternalBlock ( GraphNode  node,
SingleNodeBlocker  blocker 
)

Register blocker as being present at the specified node.

Calling this method multiple times will add multiple instances of the blocker to the node.

Note
The node will not be blocked immediately. Instead the pathfinding threads will be paused and then the update will be applied. It is however guaranteed to be applied before the next path request is started.

◆ InternalUnblock()

void InternalUnblock ( GraphNode  node,
SingleNodeBlocker  blocker 
)

Remove blocker from the specified node.

Will only remove a single instance, calling this method multiple times will remove multiple instances of the blocker from the node.

Note
The node will not be unblocked immediately. Instead the pathfinding threads will be paused and then the update will be applied. It is however guaranteed to be applied before the next path request is started.

◆ NodeContainsAnyExcept()

bool NodeContainsAnyExcept ( GraphNode  node,
List< SingleNodeBlocker selector 
)

True if the node contains any blocker which is not included in the selector list.

◆ NodeContainsAnyOf()

bool NodeContainsAnyOf ( GraphNode  node,
List< SingleNodeBlocker selector 
)

True if the node contains any blocker which is included in the selector list.

◆ Start()

void Start ( )
private

Member Data Documentation

◆ blocked

Dictionary<GraphNode, List<SingleNodeBlocker> > blocked = new Dictionary<GraphNode, List<SingleNodeBlocker> >()
private

Contains info on which SingleNodeBlocker objects have blocked a particular node.


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