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
        public void Initialize()
        {
            _fsm = new BasicFSM <ActionState> (ActionState.Unplayed);

            _fsm.SetMainCallbacks(ActionState.Unplayed, FSM_UpdateUnplayed, null, null);
            _fsm.SetMainCallbacks(ActionState.Playing, FSM_UpdatePlaying, FSM_EnterPlaying, null);
            _fsm.SetMainCallbacks(ActionState.Played, FSM_UpdatePlayed, null, null);

            _fsm.AddPossibleSwitch(ActionState.Unplayed, ActionState.Playing, FSM_ShouldSwitchToPlaying);
            _fsm.AddPossibleSwitch(ActionState.Playing, ActionState.Played, FSM_ShouldSwitchToPlayed);
        }
Ejemplo n.º 3
0
        private void BuildFSM()
        {
            _fsm = new BasicFSM <TriggeredState> (TriggeredState.Ready);

            _fsm.SetMainCallbacks(TriggeredState.Ready, FSM_UpdateReady, FSM_EnteringReady, null);
            _fsm.SetMainCallbacks(TriggeredState.Playing, FSM_UpdatePlaying, FSM_EnteringPlaying, null);
            _fsm.SetMainCallbacks(TriggeredState.Complete, FSM_UpdateComplete, FSM_EnteringComplete, null);

            _fsm.AddPossibleSwitch(TriggeredState.Ready, TriggeredState.Playing, FSM_ShouldSwitchToPlaying);
            _fsm.AddPossibleSwitch(TriggeredState.Playing, TriggeredState.Complete, FSM_ShouldSwitchToComplete);
            _fsm.AddPossibleSwitch(TriggeredState.Complete, TriggeredState.Ready, FSM_ShouldSwitchToReady);
        }
Ejemplo n.º 4
0
            private void BuildClickStateFSM()
            {
                _fsm_clickState = new BasicFSM <ClickState> (ClickState.Up);

                _fsm_clickState.SetMainCallbacks(ClickState.Up, FSM_Update_Up, FSM_Enter_Up, null);
                _fsm_clickState.SetMainCallbacks(ClickState.Down, FSM_Update_Down, FSM_Enter_Down, null);
                //_fsm_clickState.SetMainCallbacks (ClickState.Held, FSM_Update_Held, FSM_Enter_Held, null);

                _fsm_clickState.AddPossibleSwitch(ClickState.Up, ClickState.Down, FSM_Switch_UpToDown);
                _fsm_clickState.AddPossibleSwitch(ClickState.Down, ClickState.Up, FSM_Switch_DownToUp);
                //_fsm_clickState.AddPossibleSwitch (ClickState.Down, ClickState.Held, FSM_Switch_DownToHeld);
                //_fsm_clickState.AddPossibleSwitch (ClickState.Held, ClickState.Up,   FSM_Switch_HeldToUp);
            }
Ejemplo n.º 5
0
        private void BuildLoadStateFSM()
        {
            _fsm_loadState = new BasicFSM <LoadState> (LoadState.Unloaded);

            _fsm_loadState.SetMainCallbacks(LoadState.Unloaded, FSM_Update_Unloaded, FSM_Enter_Unloaded, null);
            _fsm_loadState.SetMainCallbacks(LoadState.Loading, FSM_Update_Loading, FSM_Enter_Loading, null);
            _fsm_loadState.SetMainCallbacks(LoadState.Loaded, FSM_Update_Loaded, FSM_Enter_Loaded, null);
            _fsm_loadState.SetMainCallbacks(LoadState.Unloading, FSM_Update_Unloading, FSM_Enter_Unloading, null);

            _fsm_loadState.AddPossibleSwitch(LoadState.Unloaded, LoadState.Loading, FSM_Switch_UnloadedToLoading);
            _fsm_loadState.AddPossibleSwitch(LoadState.Loading, LoadState.Loaded, FSM_Switch_LoadingToLoaded);
            _fsm_loadState.AddPossibleSwitch(LoadState.Loaded, LoadState.Unloading, FSM_Switch_LoadedToUnloading);
            _fsm_loadState.AddPossibleSwitch(LoadState.Unloading, LoadState.Unloaded, FSM_Switch_UnloadingToUnloaded);
        }
Ejemplo n.º 6
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);
        }