Example #1
0
    private void MakeFSM()
    {
        mFSMSystem = new WolfFSMSystem();

        WolfChaseState chaseState = new WolfChaseState(mFSMSystem, this);

        chaseState.AddTransition(WolfTransition.Reached, WolfStateID.AttackOrHold);

        WolfAttackOrHoldState attackOrHoldState = new WolfAttackOrHoldState(mFSMSystem, this);

        attackOrHoldState.AddTransition(WolfTransition.HoldSuccess, WolfStateID.Success);
        attackOrHoldState.AddTransition(WolfTransition.HoldFail, WolfStateID.Defeat);
        attackOrHoldState.AddTransition(WolfTransition.MissionComplete, WolfStateID.Leave);

        WolfHoldSuccessState holdSuccessState = new WolfHoldSuccessState(mFSMSystem, this);

        holdSuccessState.AddTransition(WolfTransition.MissionComplete, WolfStateID.Leave);

        WolfHoldFailState failState = new WolfHoldFailState(mFSMSystem, this);

        WolfLeaveState leaveState = new WolfLeaveState(mFSMSystem, this);

        mFSMSystem.AddState(chaseState, attackOrHoldState, holdSuccessState, failState, leaveState);
    }
Example #2
0
 public WolfHoldFailState(WolfFSMSystem fsm, ICharacter character) : base(fsm, character)
 {
     mStateID = WolfStateID.Defeat;
 }
Example #3
0
 public WolfAttackOrHoldState(WolfFSMSystem fsm, ICharacter character) : base(fsm, character)
 {
     mStateID = WolfStateID.AttackOrHold;
 }
Example #4
0
 public IWolfState(WolfFSMSystem fsm, ICharacter character)
 {
     mFSMSystem = fsm;
     mCharacter = character;
 }
Example #5
0
 public WolfChaseState(WolfFSMSystem fsm, ICharacter character) : base(fsm, character)
 {
     mStateID = WolfStateID.Chase;
 }
 public WolfHoldSuccessState(WolfFSMSystem fsm, ICharacter character) : base(fsm, character)
 {
     mStateID = WolfStateID.Success;
 }