Esempio n. 1
0
        public enum Action { Push, Pop, Clear, }; //as you might imagine, different than Player.Action

        public StateStack(State.Context context) 
        { 
            mFactories = new List<StateID>();
            mStack = new Stack<State>();
            mPendingList = new List<PendingChange>();
            mContext = context;
            //PendingChange change = new PendingChange();

          
        }
Esempio n. 2
0
        public World(State.Context context)
        {
            mWindow = context.window;
            mWorldView = mWindow.DefaultView;
            mWorldBounds = new IntRect(0, 0, (int)mWorldView.Size.X, 4000); //have to explcitly cast Size.X from float to int because of cast issues between IntRect and FloatRect later on
            mSpawnPosition = new Vector2f(mWorldView.Size.X / 2, mWorldBounds.Height - mWorldView.Size.Y); //original code is mWorldBounds.Height - mWorldView.Size, but caused error
            mScrollSpeed = -50; //this is not included in book but in source code
            mSceneLayers = new SceneNode[(int)Layer.LayerCount];
            mTextures = context.textures;
            mSceneGraph = new SceneNode();
            mPlayerAircraft = null;
            mCommandQueue = new CommandQueue();
            mEnemySpawnPoints = new List<SpawnPoint>();
            mFonts = context.fonts;

            mWorldView.Center = mSpawnPosition;

            loadTextures();
            buildScene();



        }