Jido. BehaviorTree. Nodes. SetBlackboard
(Jido Behavior Tree v1.0.0)
View Source
A leaf node that sets values in the blackboard.
Always returns :success after setting the specified key-value pairs.
Note: Since ticks are immutable, the updated blackboard is returned
in the node state for the parent to propagate.
Example
node = SetBlackboard.new(:player_health, 100)
# Sets :player_health to 100 in the blackboard
node = SetBlackboard.new(%{a: 1, b: 2})
# Sets multiple values at once
Summary
Functions
Creates a new SetBlackboard node with the specified entries.
Returns the Zoi schema for this module
Context-aware tick variant that returns the updated tick.
Types
Functions
Creates a new SetBlackboard node with the specified entries.
Examples
iex> SetBlackboard.new(%{key: "value"})
%SetBlackboard{entries: %{key: "value"}, updated_tick: nil}
iex> SetBlackboard.new(:key, "value")
%SetBlackboard{entries: %{key: "value"}, updated_tick: nil}
Returns the Zoi schema for this module
@spec tick_with_context(t(), Jido.BehaviorTree.Tick.t()) :: {Jido.BehaviorTree.Status.t(), t(), Jido.BehaviorTree.Tick.t()}
Context-aware tick variant that returns the updated tick.