Documentation ¶
Index ¶
- Constants
- type Action
- type BaseNode
- type BehaviorList
- type BehaviorTree
- type Composite
- type Condition
- type Decorator
- type DecoratorN
- type IAction
- type IBaseNode
- type IBehaviorList
- type IBehaviorTree
- type IComposite
- type ICondition
- type IDecorator
- type PSelector
- type PSequence
- type Selector
- type Sequence
Constants ¶
View Source
const ( SUCCESS = iota ERROR = iota )
View Source
const ( COMPOSITE = "composite" DECORATOR = "decorator" ACTION = "action" CONDITION = "condition" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseNode ¶
func (*BaseNode) OnEnter ¶
*
- Enter method, override this to use. It is called every time a node is
- asked to execute, before the tick itself. *
- @method enter
- @param {Tick} tick A tick instance.
*
func (*BaseNode) OnExec ¶
*
- Tick method, override this to use. This method must contain the real
- execution of node (perform a task, call children, etc.). It is called
- every time a node is asked to execute. *
- @method tick
- @param {Tick} tick A tick instance.
*
type BehaviorList ¶
func (*BehaviorList) AddChild ¶
func (b *BehaviorList) AddChild(name string, pNode IBaseNode)
func (*BehaviorList) DelChild ¶
func (b *BehaviorList) DelChild(name string)
func (*BehaviorList) GetChild ¶
func (b *BehaviorList) GetChild(name string) IBaseNode
func (*BehaviorList) GetChildCount ¶
func (b *BehaviorList) GetChildCount() int
func (*BehaviorList) Less ¶
func (b *BehaviorList) Less(i, j int) bool
type BehaviorTree ¶
type BehaviorTree struct {
BehaviorList
}
func NewBeTree ¶
func NewBeTree() *BehaviorTree
func (*BehaviorTree) Init ¶
func (b *BehaviorTree) Init()
func (*BehaviorTree) OnExec ¶
func (b *BehaviorTree) OnExec(tick int64)
type Composite ¶
type Composite struct { BaseNode BehaviorList }
type DecoratorN ¶
type DecoratorN struct {
Decorator
}
func (*DecoratorN) OnExec ¶
func (d *DecoratorN) OnExec(tick int64) bool
它将它的Child Node执行 后返回的结果值做额外处理后,再返回给它的Parent Node
type IBehaviorList ¶
type IBehaviorTree ¶
type IBehaviorTree interface { IBehaviorList Init() OnExec(int64) }
type IComposite ¶
type IComposite interface { IBaseNode IBehaviorList }
type ICondition ¶
type ICondition interface { IBaseNode }
type IDecorator ¶
Click to show internal directories.
Click to hide internal directories.