Package | krewfw.builtin_actor.system |
Class | public class KrewState |
Inheritance | KrewState ![]() |
Subclasses | KrewSubState |
Property | Defined By | ||
---|---|---|---|
childStates : Vector.<KrewState> [read-only] | KrewState | ||
guardFunc : Function [read-only] | KrewState | ||
isListening : Boolean = false | KrewState | ||
krew : KrewTopUtil [read-only] | KrewState | ||
listenList : Array [read-only] | KrewState | ||
nextStateId : String | KrewState | ||
onBeginHandler : Function [read-only] | KrewState | ||
onEndHandler : Function [read-only] | KrewState | ||
onEnterHandler : Function [read-only] | KrewState | ||
onExitHandler : Function [read-only] | KrewState | ||
onUpdateHandler : Function [read-only] | KrewState | ||
parentState : KrewState | KrewState | ||
sharedObj : KrewSharedObjects [read-only] | KrewState | ||
stateId : String [read-only] | KrewState | ||
stateMachine : KrewStateMachine [write-only] | KrewState |
Method | Defined By | ||
---|---|---|---|
KrewState(stateDef:Object, funcOwner:Object = null, prefix:String)
Create state with Object key-values. | KrewState | ||
addState(stateDef:*, funcOwner:Object = null, prefix:String):void
Add sub state. | KrewState | ||
createActor(newActor:KrewActor, layerName:String = null):void | KrewState | ||
delayed(timeout:Number, task:Function):void | KrewState | ||
dispose():void | KrewState | ||
dump():void | KrewState | ||
dumpTree(level:int = 0):void | KrewState | ||
eachChild(iterator:Function):void
Iterate state tree downward. | KrewState | ||
eachParent(iterator:Function):void
Iterate state tree upward. | KrewState | ||
hasChildren():Boolean | KrewState | ||
hasParent():Boolean | KrewState | ||
Return true if arg is my child state (grandchild is a child.) | KrewState | ||
Return true if arg is same state instance. | KrewState | ||
[static]
| KrewState | ||
onEvent(args:Object, event:String):void
イベントを受け取った際、 KrewStateMachine から呼ばれるハンドラ。
State は自分が listen しているイベントでなければ、親 state に委譲する。
自分が listen しているイベントだった場合でも、
guard に指定した function が false を返す間は、遷移を行わない。
guard を通過した際、hook が指定されていればそれに (state, eventArgs) を渡して呼ぶ。
その後、to に指定されていたステートへ遷移する
| KrewState | ||
Go on the next state. | KrewState | ||
sendMessage(eventType:String, eventArgs:Object = null):void | KrewState |
childStates | property |
childStates:Vector.<KrewState>
[read-only] public function get childStates():Vector.<KrewState>
guardFunc | property |
guardFunc:Function
[read-only] public function get guardFunc():Function
isListening | property |
public var isListening:Boolean = false
krew | property |
listenList | property |
listenList:Array
[read-only] public function get listenList():Array
nextStateId | property |
nextStateId:String
public function get nextStateId():String
public function set nextStateId(value:String):void
onBeginHandler | property |
onBeginHandler:Function
[read-only] public function get onBeginHandler():Function
onEndHandler | property |
onEndHandler:Function
[read-only] public function get onEndHandler():Function
onEnterHandler | property |
onEnterHandler:Function
[read-only] public function get onEnterHandler():Function
onExitHandler | property |
onExitHandler:Function
[read-only] public function get onExitHandler():Function
onUpdateHandler | property |
onUpdateHandler:Function
[read-only] public function get onUpdateHandler():Function
parentState | property |
parentState:KrewState
public function get parentState():KrewState
public function set parentState(value:KrewState):void
sharedObj | property |
sharedObj:KrewSharedObjects
[read-only] public function get sharedObj():KrewSharedObjects
stateId | property |
stateId:String
[read-only] public function get stateId():String
stateMachine | property |
stateMachine:KrewStateMachine
[write-only] public function set stateMachine(value:KrewStateMachine):void
KrewState | () | Constructor |
public function KrewState(stateDef:Object, funcOwner:Object = null, prefix:String)
Create state with Object key-values.
ParametersstateDef:Object — Object including state options such as:
| |
funcOwner:Object (default = null )
| |
prefix:String |
addState | () | method |
public function addState(stateDef:*, funcOwner:Object = null, prefix:String):void
Add sub state.
Parameters
stateDef:* — KrewState のインスタンスか、State 定義情報を含む Object.
Object のフォーマットについては KrewState 及び KrewStateMachine の
コンストラクタのドキュメントを見よ。
| |
funcOwner:Object (default = null )
| |
prefix:String |
createActor | () | method |
public function createActor(newActor:KrewActor, layerName:String = null):void
Parameters
newActor:KrewActor | |
layerName:String (default = null )
|
delayed | () | method |
public function delayed(timeout:Number, task:Function):void
Parameters
timeout:Number | |
task:Function |
dispose | () | method |
public function dispose():void
dump | () | method |
public function dump():void
dumpTree | () | method |
public function dumpTree(level:int = 0):void
Parameters
level:int (default = 0 )
|
eachChild | () | method |
public function eachChild(iterator:Function):void
Iterate state tree downward. Passes itself and children to iterator function.
Parameters
iterator:Function — function(state:KrewState):void
|
eachParent | () | method |
public function eachParent(iterator:Function):void
Iterate state tree upward. Passes itself and parents to iterator function.
Parameters
iterator:Function — function(state:KrewState):void
|
hasChildren | () | method |
public function hasChildren():Boolean
ReturnsBoolean |
hasParent | () | method |
public function hasParent():Boolean
ReturnsBoolean |
isChild | () | method |
public function isChild(state:KrewState, nestCount:int = 0):Boolean
Return true if arg is my child state (grandchild is a child.)
Parameters
state:KrewState | |
nestCount:int (default = 0 )
|
Boolean |
isEqual | () | method |
public function isEqual(state:KrewState):Boolean
Return true if arg is same state instance.
Parameters
state:KrewState |
Boolean |
makeState | () | method |
public static function makeState(stateDef:*, funcOwner:Object = null, prefix:String):KrewState
Parameters
stateDef:* | |
funcOwner:Object (default = null )
| |
prefix:String |
KrewState |
See also
onEvent | () | method |
public function onEvent(args:Object, event:String):void
イベントを受け取った際、 KrewStateMachine から呼ばれるハンドラ。 State は自分が listen しているイベントでなければ、親 state に委譲する。 自分が listen しているイベントだった場合でも、 guard に指定した function が false を返す間は、遷移を行わない。 guard を通過した際、hook が指定されていればそれに (state, eventArgs) を渡して呼ぶ。 その後、to に指定されていたステートへ遷移する
Parameters
args:Object | |
event:String |
proceed | () | method |
public function proceed(state:KrewState = null):void
Go on the next state. [Hint] すぐに次のステートに遷移させたいような場合の定義には enter: proceed と書けばよい
Parameters
state:KrewState (default = null )
|
sendMessage | () | method |
public function sendMessage(eventType:String, eventArgs:Object = null):void
Parameters
eventType:String | |
eventArgs:Object (default = null )
|