A* Pathfinding Project  4.0.11
The A* Pathfinding Project for Unity 3D
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Properties Events Macros Groups Pages
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.
 
void InternalUnblock (GraphNode node, SingleNodeBlocker blocker)
 Remove blocker from the specified node.
 
bool NodeContainsAnyExcept (GraphNode node, List< SingleNodeBlocker > selector)
 True if the node contains any blocker which is not included in the selector list.
 
bool NodeContainsAnyOf (GraphNode node, List< SingleNodeBlocker > selector)
 True if the node contains any blocker which is included in the selector list.
 

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.
 

Additional Inherited Members

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

Member Enumeration Documentation

enum BlockMode
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

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.
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.
bool NodeContainsAnyExcept ( GraphNode  node,
List< SingleNodeBlocker selector 
)

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

bool NodeContainsAnyOf ( GraphNode  node,
List< SingleNodeBlocker selector 
)

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

void Start ( )
private

Member Data Documentation

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: