Documentation
¶
Index ¶
Constants ¶
View Source
const ( NodeStateSuccess NodeState = iota NodeStateFailure = 1 NodeStateRunning = 2 NodeStateCancel = 3 )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseBehaviorNode ¶
type BaseBehaviorNode struct { Children []BehaviorNode // contains filtered or unexported fields }
func (*BaseBehaviorNode) AddChild ¶
func (slf *BaseBehaviorNode) AddChild(nodes ...BehaviorNode)
func (*BaseBehaviorNode) GetChildren ¶
func (slf *BaseBehaviorNode) GetChildren() []BehaviorNode
func (*BaseBehaviorNode) GetTree ¶
func (slf *BaseBehaviorNode) GetTree() *BehaviorTree
func (*BaseBehaviorNode) SetTree ¶
func (slf *BaseBehaviorNode) SetTree(tree *BehaviorTree)
type BehaviorNode ¶
type BehaviorNode interface { Run() NodeState AddChild(nodes ...BehaviorNode) GetChildren() []BehaviorNode SetTree(tree *BehaviorTree) GetTree() *BehaviorTree }
type BehaviorTree ¶
type BehaviorTree struct { Root BehaviorNode // contains filtered or unexported fields }
func NewBehaviorTree ¶
func NewBehaviorTree(root BehaviorNode, opts ...Option) *BehaviorTree
func (*BehaviorTree) GetProperty ¶
func (slf *BehaviorTree) GetProperty(key string) any
func (*BehaviorTree) Run ¶
func (slf *BehaviorTree) Run(cycle, duration time.Duration)
func (*BehaviorTree) SetProperty ¶
func (slf *BehaviorTree) SetProperty(key string, value any)
type Option ¶
type Option func(*BehaviorTree)
type RandomSelectorNode ¶
type RandomSelectorNode struct {
BaseBehaviorNode
}
func NewRandomSelectorNode ¶
func NewRandomSelectorNode() *RandomSelectorNode
func (*RandomSelectorNode) Run ¶
func (slf *RandomSelectorNode) Run() NodeState
type SelectorNode ¶
type SelectorNode struct {
BaseBehaviorNode
}
func NewSelectorNode ¶
func NewSelectorNode() *SelectorNode
func (*SelectorNode) Run ¶
func (slf *SelectorNode) Run() NodeState
type SequenceNode ¶
type SequenceNode struct {
BaseBehaviorNode
}
func NewSequenceNode ¶
func NewSequenceNode() *SequenceNode
func (*SequenceNode) Run ¶
func (slf *SequenceNode) Run() NodeState
Click to show internal directories.
Click to hide internal directories.