Ejemplo n.º 1
0
        private Boolean SetNextState(CSIState newState)
        {
            bool success = false;

            if (newState != null)
            {
                CSIState _previousState = _currentState;

                // Old state gets notified it is changing out.
                if (_previousState != null)
                {
                    //AppI_Debug.ShowMsg("setNextState Old:" + _previousState.ToString());
                    _previousState.Exit();
                }

                //AppI_Debug.ShowMsg("setNextState Current: " + newState.ToString());

                _currentState = newState;
                _nextState    = null;

                if (_currentState != null)
                {
                    //Note the time at which we entered this state.
                    _enteredStateTime = TimeHelp.GetCurrentMS();
                    _currentState.Enter(this);
                    success = true;
                }
            }
            else
            {
                AppI_Debug.ShowMsg("setNextState: ERROR:NULL STATE!");
                success = false;
            }
            return(success);
        }
Ejemplo n.º 2
0
            protected void thisEnter()
            {
                AppI_Debug.ShowMsg("BaseAct Controller proc_Main thisEnter");

                MainRoot.GetUIMgr().HudCamPegs.gameObject.SetActive(true);
                MainRoot.GetUIMgr().HudQuads.gameObject.SetActive(true);
                MainRoot.GetUIMgr().HUDSpares.gameObject.SetActive(true);
            }
Ejemplo n.º 3
0
        public CSIProc getProc(string name)
        {
            //handlers when the Procs returned here trying to be accessed are null
            if (controllerProcs.ContainsKey(name))
            {
                return(controllerProcs[name] as CSIProc);
            }

            AppI_Debug.ShowMsg("ERROR! " + getCurrentProcessName() + " NO Controller for Proc: " + name);
            //bad proc
            return(null);
        }
Ejemplo n.º 4
0
            protected void thisEnter()
            {
                AppI_Debug.ShowMsg("BaseAct Controller proc_Boot thisEnter");

                SceneManager.sceneUnloaded += OnPlanetSceneUnloaded;

                ((BaseActController)actBase).planeObj.SetActive(true);
                ((BaseActController)actBase).terrainObj.SetActive(true);
                ((BaseActController)actBase).sunObj.SetActive(false);

                SceneManager.UnloadSceneAsync(MainRoot.GetAppConf().homeToLoad);
            }
Ejemplo n.º 5
0
        public string getProcessName(CSIProc proc)
        {
            if (proc == null)
            {
                //AppI_Debug.ShowMsg("getProcessName: ERROR: PROC NULL!");
                return("NULL");
            }

            foreach (KeyValuePair <string, CSIProc> dictEntry in controllerProcs)
            {
                if (controllerProcs[dictEntry.Key] == proc)
                {
                    return(dictEntry.Key);
                }
            }

            AppI_Debug.ShowMsg("getProcessName: ERROR: NOT FOUND! " + proc.GetProcessStateName());
            return("NoControllerProc");
        }
Ejemplo n.º 6
0
        public CSIState GetState(string name)
        {
            //handlers when the states returned here trying to be accessed are null
            if (machineStates.ContainsKey(name))
            {
                CSIState retState = machineStates[name] as CSIState;
                if (retState == null)
                {
                    //error condition
                    AppI_Debug.ShowMsg("getState: " + name + " ERROR: NULL!");
                    return(null);
                }
                return(retState);
            }

            //error condition
            AppI_Debug.ShowMsg("getState: " + name + " ERROR:NOT FOUND!");
            return(null);
        }
Ejemplo n.º 7
0
        //forced to by pass the queue
        public Boolean setNextProcNamed(string name)
        {
            Boolean retVal = false;

            CSIProc newProc = getProc(name);

            retVal = setNextProcess(newProc);
            if (newProc != null)
            {
                _currentProc.StopProcess();
                newProc.StartProcess();
                _currentProc = newProc;
                retVal       = true;
            }

            if (retVal == false)
            {
                AppI_Debug.ShowMsg("Process Not Found Warning: " + name);
            }

            return(retVal);
        }
Ejemplo n.º 8
0
        public bool EvaluateController()
        {
            bool retVal = true;

            if (_currentState != null)
            {
                _currentState.Evaluate();

                if ((_currentState != _nextState) && (_nextState != null))
                {
                    SetNextState(_nextState);
                }

                //AppI_Debug.ShowMsg("Evaluate _currentState Parent: " + parentName + " Machine: " + machineName);
            }
            else
            {
                AppI_Debug.ShowMsg(string.Format("NULL _currentState evaluateController! Parent: {0}  Machine: {1} State: {2}", parentName, machineName, GetCurrentStateName()));
                retVal = false;
            }

            //AppI_Debug.ShowMsg("Evaluate _currentState State : " + getCurrentStateName() + " Last : " + getPreviousStateName());
            return(retVal);
        }
Ejemplo n.º 9
0
 protected void thisEnter()
 {
     AppI_Debug.ShowMsg("BaseAct Controller proc_Exit thisEnter");
 }