Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Parent<S, E> Abstract

Base class for all nodes that expose a list of children. Primarily used to support the visualization of the behavior tree using dotTree or archyTree

author

Mark Asdoorian

Type Parameters

Hierarchy

Implements

Index

Constructors

  • new Parent<S, E>(name: string): Parent<S, E>

Properties

name: string = ''
treePublisher: TreePublisher<any, any> = ...

Accessors

  • get id(): string
  • get parent(): string
  • set parent(parent: string): void
  • get path(): string
  • get symbol(): string

Methods

  • getDebug(state: S): any
  • getLastEventSeen(state: S): undefined | number
  • getLastResult(state: S): undefined | string
  • getTreeEventCounter(state: S): any
  • initChildren(children: BaseNode<S, E>[]): void
  • Initializes the parent of our list of children. Only required to be called if you know your children at construction time. If your children are dynamic, then you are responsible for setting their parent properly when they are created. Note: this repeats code from set parent() because at construction time, this.children will not return anything (this isn't this yet), which is why we have to pass children in as a parameter

    Parameters

    • children: BaseNode<S, E>[]

      list of children to init (can't call getChildren() yet because this is called from the constructor)

    Returns void

  • precondition(state: S, event: E): boolean
  • resetNodeStorage(state: S): any
  • registerNodeForDebug<S, E>(node: BaseNode<S, E>): void
  • registerTreePublisher<S, E>(publisher: TreePublisher<S, E>): void
  • unregisterNodeForDebug<S, E>(node: BaseNode<S, E>): void