class BehaviorTree::Decorators::DecoratorBase

Base class for a decorator node.

Public Instance Methods

ensure_after_tick() click to toggle source
# File lib/behavior_tree/decorator_nodes/decorator_base.rb, line 14
def ensure_after_tick
  status_map
end
halt!() click to toggle source
Calls superclass method
# File lib/behavior_tree/decorator_nodes/decorator_base.rb, line 18
def halt!
  super

  status_map
end
on_tick() click to toggle source
Calls superclass method
# File lib/behavior_tree/decorator_nodes/decorator_base.rb, line 9
def on_tick
  super
  decorate
end

Protected Instance Methods

decorate() click to toggle source

Decorate behavior. Retry, repeat, etc. Leave empty if there's no extra behavior to add. Default behavior is to do nothing additional. @return [void]

# File lib/behavior_tree/decorator_nodes/decorator_base.rb, line 30
def decorate; end
status_map() click to toggle source

This method must change the self node status in function of the child status. The default behavior is to copy its status. @return [void]

# File lib/behavior_tree/decorator_nodes/decorator_base.rb, line 35
def status_map
  self.status = child.status
end