Beispiel #1
0
        public StateStack(Context context)
        {
            mContext = context;
            mStack = new Stack<State>();
            mPendingList = new List<PendingChange>();

            TitleState state = new TitleState(this,mContext);
        }
Beispiel #2
0
        private State createState(StateID stateID)
        {
            State state = null;
            try
            {
                switch (stateID)
                {
                    case StateID.Menu:
                        state = new MenuState(this, mContext);
                        break;
                    case StateID.Game:
                        state = new GameState(this, mContext);
                        break;
                    case StateID.Pause:
                        state = new PauseState(this, mContext);
                        break;
                    case StateID.Title:
                        state = new TitleState(this, mContext);
                        break;
                }
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message + " In state creation");
            }

            return state;
        }