コード例 #1
0
ファイル: State.cs プロジェクト: shadowlink/BattleTank
        StateManager manager; //Manager de estados

        #endregion Fields

        #region Constructors

        public State(Game game)
        {
            this.game = game;
            manager = game.Services.GetService(typeof(StateManager)) as StateManager;
            content = game.Services.GetService(typeof(ContentManager)) as ContentManager;
            graphics = game.Services.GetService(typeof(IGraphicsDeviceService)) as GraphicsDeviceManager;
        }
コード例 #2
0
ファイル: Game1.cs プロジェクト: shadowlink/BattleTank
        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            this.graphics.PreferredBackBufferWidth = 1360;
            this.graphics.PreferredBackBufferHeight = 760;
            this.graphics.IsFullScreen = false;
            this.IsMouseVisible = false;

            Window.Title = "BattleTank v0.6";
            Content.RootDirectory = "Content";

            _stateManager = new StateManager(this);
            Components.Add(_stateManager);
            Components.Add(new GamerServicesComponent(this));

            Services.AddService(typeof(ContentManager), Content);
            Services.AddService(typeof(StateManager), _stateManager);
            Services.AddService(typeof(GraphicsDeviceManager), graphics);
        }