Documentation
¶
Index ¶
- Variables
- func DefaultDoFunc(n *Node) (behaviortree.Status, error)
- func DefaultDoFuncFailure(n *Node) (behaviortree.Status, error)
- func DefaultDoFuncSuccess(n *Node) (behaviortree.Status, error)
- func DoFuncRegister(doFunc DoFunc)
- func TickAll(n *Node) behaviortree.Tick
- func TickRepeatUntilSuccessSequence(n *Node) behaviortree.Tick
- func TickSelector(n *Node) behaviortree.Tick
- func TickSequence(n *Node) behaviortree.Tick
- type DoFunc
- type FindNode
- type Node
- func (n *Node) Dump()
- func (n *Node) Find(req FindNode) (*Node, error)
- func (n *Node) FindCurrentTickNode() (*Node, error)
- func (n *Node) GetBTNodes() []behaviortree.Node
- func (n *Node) GetBlackboard() interface{}
- func (n *Node) GetDoFunc() DoFunc
- func (n *Node) GetLocalBlackboard(key string) interface{}
- func (n *Node) GetNodeInstance() *NodeInstance
- func (n *Node) GetTick() (behaviortree.Tick, error)
- func (n *Node) IsDone() bool
- func (n *Node) IsRoot() bool
- func (n *Node) PreRunCheck() bool
- func (n *Node) PrintTreePath()
- func (n *Node) PushOutput(output string)
- func (n *Node) SetLocalBlackboard(key string, value interface{})
- type NodeInstance
- func (ni *NodeInstance) BuildBehaviorTree() error
- func (ni *NodeInstance) Context() context.Context
- func (ni *NodeInstance) IsDone() bool
- func (ni *NodeInstance) JumpOver(req FindNode) error
- func (ni *NodeInstance) Marshal() ([]byte, error)
- func (ni *NodeInstance) PrintTreePath()
- func (ni *NodeInstance) Retry() error
- func (ni *NodeInstance) SetDumpFunc(fn func(ctx context.Context, n *Node) error)
- func (ni *NodeInstance) Tick() (behaviortree.Status, error)
- func (ni *NodeInstance) WithContext(ctx context.Context)
- type TickType
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DoFuncDefault = "" DoFuncSuccess = "success" DoFuncFailure = "failure" )
Functions ¶
func DefaultDoFunc ¶
func DefaultDoFunc(n *Node) (behaviortree.Status, error)
func DefaultDoFuncFailure ¶
func DefaultDoFuncFailure(n *Node) (behaviortree.Status, error)
func DefaultDoFuncSuccess ¶
func DefaultDoFuncSuccess(n *Node) (behaviortree.Status, error)
func DoFuncRegister ¶
func DoFuncRegister(doFunc DoFunc)
func TickAll ¶
func TickAll(n *Node) behaviortree.Tick
func TickRepeatUntilSuccessSequence ¶
func TickRepeatUntilSuccessSequence(n *Node) behaviortree.Tick
func TickSelector ¶
func TickSelector(n *Node) behaviortree.Tick
func TickSequence ¶
func TickSequence(n *Node) behaviortree.Tick
Types ¶
type Node ¶
type Node struct {
DoFunc DoFunc `json:"-"`
Tick behaviortree.Tick `json:"-"`
Error error `json:"-"`
ID string `json:"id,omitempty"`
PreCheckExpression string `json:"pre_check_expression,omitempty"`
DoFuncName string `json:"do_func_name,omitempty"`
TickType TickType `json:"tick_type,omitempty"`
Name string `json:"name,omitempty"`
Alias string `json:"alias,omitempty"`
Path []int `json:"path,omitempty"`
Children []*Node `json:"children,omitempty"`
Output []string `json:"output,omitempty"`
Status behaviortree.Status `json:"status,omitempty"`
Deprecated bool `json:"deprecated,omitempty"`
LocalBlackboard map[string]interface{} `json:"local_blackboard,omitempty"`
// contains filtered or unexported fields
}
func (*Node) FindCurrentTickNode ¶
func (*Node) GetBTNodes ¶
func (n *Node) GetBTNodes() []behaviortree.Node
func (*Node) GetBlackboard ¶
func (n *Node) GetBlackboard() interface{}
func (*Node) GetLocalBlackboard ¶
func (*Node) GetNodeInstance ¶
func (n *Node) GetNodeInstance() *NodeInstance
func (*Node) PreRunCheck ¶
func (*Node) PrintTreePath ¶
func (n *Node) PrintTreePath()
func (*Node) PushOutput ¶
func (*Node) SetLocalBlackboard ¶
type NodeInstance ¶
type NodeInstance struct {
ID string `json:"id,omitempty"`
Root *Node `json:"root"`
Blackboard interface{} `json:"blackboard"`
CurrentPath []int `json:"current_path"`
// contains filtered or unexported fields
}
func (*NodeInstance) BuildBehaviorTree ¶
func (ni *NodeInstance) BuildBehaviorTree() error
func (*NodeInstance) Context ¶
func (ni *NodeInstance) Context() context.Context
func (*NodeInstance) IsDone ¶
func (ni *NodeInstance) IsDone() bool
func (*NodeInstance) JumpOver ¶
func (ni *NodeInstance) JumpOver(req FindNode) error
func (*NodeInstance) Marshal ¶
func (ni *NodeInstance) Marshal() ([]byte, error)
func (*NodeInstance) PrintTreePath ¶
func (ni *NodeInstance) PrintTreePath()
func (*NodeInstance) Retry ¶
func (ni *NodeInstance) Retry() error
func (*NodeInstance) SetDumpFunc ¶
func (ni *NodeInstance) SetDumpFunc(fn func(ctx context.Context, n *Node) error)
func (*NodeInstance) Tick ¶
func (ni *NodeInstance) Tick() (behaviortree.Status, error)
func (*NodeInstance) WithContext ¶
func (ni *NodeInstance) WithContext(ctx context.Context)
Click to show internal directories.
Click to hide internal directories.