Ejemplo n.º 1
0
        private void InitializeMouseStateFSM()
        {
            _fsm_mouseState = new BasicFSM <MouseState> (MouseState.Stopped);

            _fsm_mouseState.SetMainCallbacks(MouseState.Stopped, FSM_Update_Stopped, FSM_Enter_Stopped, null);
            _fsm_mouseState.SetMainCallbacks(MouseState.Moving, FSM_Update_Moving, FSM_Enter_Moving, null);

            _fsm_mouseState.AddPossibleSwitch(MouseState.Stopped, MouseState.Moving, FSM_Switch_StoppedToMoving);
            _fsm_mouseState.AddPossibleSwitch(MouseState.Moving, MouseState.Stopped, FSM_Switch_MovingToStopped);
        }
Ejemplo n.º 2
0
        private void BuildDyingStateFSM()
        {
            _fsm_dyingState = new BasicFSM <DyingState> (DyingState.Alive);

            _fsm_dyingState.SetMainCallbacks(DyingState.Alive, FSM_Update_Alive, FSM_Enter_Alive, null);
            _fsm_dyingState.SetMainCallbacks(DyingState.Dying, FSM_Update_Dying, FSM_Enter_Dying, null);
            _fsm_dyingState.SetMainCallbacks(DyingState.Killed, FSM_Update_Killed, FSM_Enter_Killed, null);
            _fsm_dyingState.SetMainCallbacks(DyingState.Reviving, FSM_Update_Reviving, FSM_Enter_Reviving, null);

            _fsm_dyingState.AddPossibleSwitch(DyingState.Alive, DyingState.Dying, FSM_Switch_AliveToDying);
            _fsm_dyingState.AddPossibleSwitch(DyingState.Dying, DyingState.Killed, FSM_Switch_DyingToKilled);
            _fsm_dyingState.AddPossibleSwitch(DyingState.Killed, DyingState.Reviving, FSM_Switch_KilledToReviving);
            _fsm_dyingState.AddPossibleSwitch(DyingState.Reviving, DyingState.Alive, FSM_Switch_RevivingToAlive);
        }