示例#1
0
        public Main()
        {
            graphics = new GraphicsDeviceManager(this);
            graphics.PreferredBackBufferHeight = BackBufferHeight;
            graphics.PreferredBackBufferWidth  = BackBufferWidth;
            Window.Title          = "Pathfinding Profiler v1.0";
            Content.RootDirectory = "content";
            this.IsMouseVisible   = true;

            // Set frame rate
            TargetElapsedTime = TimeSpan.FromTicks(TimeSpan.TicksPerSecond / TargetFrameRate);

            // Add Components
            menu         = new ProfilerMenu(this);
            input        = new InputHandler(this);
            levelHandler = new LevelHandler(this);

            GameUtils.AddUtil <GameComponentCollection>(Components);
            GameUtils.GetUtil <GameComponentCollection>().Add(menu);
            GameUtils.GetUtil <GameComponentCollection>().Add(input);
            GameUtils.GetUtil <GameComponentCollection>().Add(levelHandler);

            levelHandler.Enabled = false;
            levelHandler.Visible = false;

            SetState(typeof(ProfilerMenu));
        }
示例#2
0
        public Main()
        {
            graphics = new GraphicsDeviceManager(this);
            graphics.PreferredBackBufferHeight = BackBufferHeight;
            graphics.PreferredBackBufferWidth = BackBufferWidth;
            Window.Title = "Pathfinding Profiler v1.0";
            Content.RootDirectory = "content";
            this.IsMouseVisible = true;

            // Set frame rate
            TargetElapsedTime = TimeSpan.FromTicks(TimeSpan.TicksPerSecond / TargetFrameRate);

            // Add Components
            menu = new ProfilerMenu(this);
            input = new InputHandler(this);
            levelHandler = new LevelHandler(this);

            GameUtils.AddUtil<GameComponentCollection>(Components);
            GameUtils.GetUtil<GameComponentCollection>().Add(menu);
            GameUtils.GetUtil<GameComponentCollection>().Add(input);
            GameUtils.GetUtil<GameComponentCollection>().Add(levelHandler);

            levelHandler.Enabled = false;
            levelHandler.Visible = false;

            SetState(typeof(ProfilerMenu));
        }