Example #1
0
        /// <summary>
        /// Used as second step on singleton initialisation. Used to specific code of the different Engine & Game managers
        /// 
        /// The GameMgr starts all the BSEngine managers and the different app states
        /// </summary>
        /// <returns>Should return true if everything went ok</returns>
        private bool open(BSEngineLoader loader)
        {
            m_stateStack = new Stack<State>();
            m_initializedStates = new Dictionary<string, State>();
            m_nextState = null;
            m_changeNextState = false;
            m_loader = loader;

            StorageMgr.Init();

            m_initializedStates = loader.States;

            foreach (string s in m_initializedStates.Keys)
            {
                m_initializedStates[s].Init();
            }

            InputMgr.Init();
            PoolMgr.Init();
            SceneMgr.Init();

            return true;
        }
Example #2
0
 /// <summary>
 /// This method will clear the stack, deactivating all the states into it. Then it will push a new state into it.
 /// </summary>
 /// <param name="stateName">Name of the State to push into the stack</param>
 public void ChangeState(string stateName)
 {
     if(m_initializedStates.ContainsKey(stateName))
     {
         m_nextState = m_initializedStates[stateName];
         m_changeNextState = true;
     }
 }