Ejemplo n.º 1
0
        /// <summary>
        /// Base Game Constructor using a custom Window Title
        /// </summary>
        /// <param name="title">Title that will display at the top of our game window</param>
        protected GameBase(string title)
        {
            graphics = new GraphicsDeviceManager(this);
            graphics.PreparingDeviceSettings += new EventHandler <PreparingDeviceSettingsEventArgs>(PreparingDeviceSettings);

            GameSetting.Initialize();
            UserSetting.Initialize();
            ApplyResolution();

            Window.Title  = title;
            _windowBounds = Window.ClientBounds;

            this.IsMouseVisible = true;

            content = new ContentManager(this.Services);
            content.RootDirectory = "Content";

            //Game Components - Our base initializer will initialize them all for us
            //Network Manager
            _networkManager = new NetworkManager(this);
            Components.Add(_networkManager);

            //Input
            _input = new InputHandler(this);
            Components.Add(_input);

            //FPS Counter
            _fps = new FPSCounter(this);
            Components.Add(_fps);

            //Notification Display Component
            _messageDisplay = new Screens.MessageDisplay(this);
            Components.Add(_messageDisplay);

            //Texture Manager
            _textureManager = new TextureManager(this);
            Components.Add(_textureManager);

            //Screen Manager
            _screenManager = new ScreenManager(this);
            Components.Add(_screenManager);

            //Camera Manager
            _cameraManager = new CameraManager(this);
            Components.Add(_cameraManager);

            //Chat Manager
            _chatManager = new ChatManager(this);
            Components.Add(_chatManager);
        }