C# 클래스 FsmState, nightmare_cooperative

This class represents the States in the Finite State System. Each state has a Dictionary with pairs (transition-state) showing which state the FSM should be if a transition is fired while this state is the current state. Method Reason is used to determine which transition should be fired . Method Act has the code to perform the actions the NPC is supposed do if it's on this state.
파일 보기 프로젝트 열기: jonbro/nightmare_cooperative 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
machine FsmSystem,
stateID FsmStateId
transitionMap FsmStateId>.Dictionary

공개 메소드들

메소드 설명
AddTransition ( FsmTransitionId trans, FsmStateId id ) : void
DeleteTransition ( FsmTransitionId trans ) : void

This method deletes a pair transition-state from this state's map. If the transition was not inside the state's map, an ERROR message is printed.

DoBeforeEntering ( ) : void

This method is used to set up the State condition before entering it. It is called automatically by the FSMSystem class before assigning it to the current state.

DoBeforeLeaving ( ) : void

This method is used to make anything necessary, as reseting variables before the FSMSystem changes to another one. It is called automatically by the FSMSystem before changing to a new state.

FsmState ( FsmStateId _stateId ) : System
GetOutputState ( FsmTransitionId trans ) : FsmStateId

This method returns the new state the FSM should be if this state receives a transition and

OnGui ( ) : void
PerformTransition ( FsmTransitionId trans ) : void
SetOwner ( FsmSystem, _fsm ) : void
Update ( ) : void

This method is a generic update - just do stuff that this state does per frame

WithBeforeEnteringAction ( Action action ) : FsmState,
WithBeforeLeavingAction ( Action action ) : FsmState,
WithOnGuiAction ( Action action ) : FsmState,
WithTransition ( FsmTransitionId trans, FsmStateId id ) : FsmState,
WithUpdateAction ( Action action ) : FsmState,

메소드 상세

AddTransition() 공개 메소드

public AddTransition ( FsmTransitionId trans, FsmStateId id ) : void
trans FsmTransitionId
id FsmStateId
리턴 void

DeleteTransition() 공개 메소드

This method deletes a pair transition-state from this state's map. If the transition was not inside the state's map, an ERROR message is printed.
public DeleteTransition ( FsmTransitionId trans ) : void
trans FsmTransitionId
리턴 void

DoBeforeEntering() 공개 메소드

This method is used to set up the State condition before entering it. It is called automatically by the FSMSystem class before assigning it to the current state.
public DoBeforeEntering ( ) : void
리턴 void

DoBeforeLeaving() 공개 메소드

This method is used to make anything necessary, as reseting variables before the FSMSystem changes to another one. It is called automatically by the FSMSystem before changing to a new state.
public DoBeforeLeaving ( ) : void
리턴 void

FsmState() 공개 메소드

public FsmState ( FsmStateId _stateId ) : System
_stateId FsmStateId
리턴 System

GetOutputState() 공개 메소드

This method returns the new state the FSM should be if this state receives a transition and
public GetOutputState ( FsmTransitionId trans ) : FsmStateId
trans FsmTransitionId
리턴 FsmStateId

OnGui() 공개 메소드

public OnGui ( ) : void
리턴 void

PerformTransition() 공개 메소드

public PerformTransition ( FsmTransitionId trans ) : void
trans FsmTransitionId
리턴 void

SetOwner() 공개 메소드

public SetOwner ( FsmSystem, _fsm ) : void
_fsm FsmSystem,
리턴 void

Update() 공개 메소드

This method is a generic update - just do stuff that this state does per frame
public Update ( ) : void
리턴 void

WithBeforeEnteringAction() 공개 메소드

public WithBeforeEnteringAction ( Action action ) : FsmState,
action Action
리턴 FsmState,

WithBeforeLeavingAction() 공개 메소드

public WithBeforeLeavingAction ( Action action ) : FsmState,
action Action
리턴 FsmState,

WithOnGuiAction() 공개 메소드

public WithOnGuiAction ( Action action ) : FsmState,
action Action
리턴 FsmState,

WithTransition() 공개 메소드

public WithTransition ( FsmTransitionId trans, FsmStateId id ) : FsmState,
trans FsmTransitionId
id FsmStateId
리턴 FsmState,

WithUpdateAction() 공개 메소드

public WithUpdateAction ( Action action ) : FsmState,
action Action
리턴 FsmState,

프로퍼티 상세

machine 보호되어 있는 프로퍼티

protected FsmSystem, machine
리턴 FsmSystem,

stateID 보호되어 있는 프로퍼티

protected FsmStateId stateID
리턴 FsmStateId

transitionMap 보호되어 있는 프로퍼티

protected Dictionary transitionMap
리턴 FsmStateId>.Dictionary