示例#1
0
        protected override void LoadContent()
        {
            this.camera   = new PerspectiveCamera(this.GraphicsDevice.Viewport);
            this.injector = new Injector(this);

            this.injector.Resolve <Content>().LoadContent(this.Content);

            this.spriteBatch    = this.injector.Resolve <SpriteBatch>();
            this.renderPipeline = this.injector.Resolve <DeferredRenderPipeline>();
            this.sceneSelector  = this.injector.Resolve <SceneSelector>();

            this.server   = this.injector.Resolve <Server>();
            this.client   = this.injector.Resolve <Client>();
            this.keyboard = this.injector.Resolve <UI.Input.KeyboardInput>();

            this.metricServer = this.injector.Resolve <IMetricServer>();
            this.metricServer.Start(7070);


            this.uiManager = this.injector.Resolve <UIManager>();
            this.uiManager.LoadState();


            if (this.uiManager.State.NetState.AutoStartServer)
            {
                this.server.Start(Server.DefaultServerPort);
            }

            if (this.uiManager.State.NetState.AutoStartClient)
            {
                this.client.Connect(new IPEndPoint(IPAddress.Loopback, Server.DefaultServerPort));
            }
        }
示例#2
0
        protected override void LoadContent()
        {
            this.camera   = new PerspectiveCamera(this.GraphicsDevice.Viewport);
            this.injector = new Injector(this);

            this.spriteBatch    = this.injector.Resolve <SpriteBatch>();
            this.renderPipeline = this.injector.Resolve <DeferredRenderPipeline>();
            this.sceneSelector  = this.injector.Resolve <SceneSelector>();
            this.uiManager      = this.injector.Resolve <UIManager>();

            this.metricServer = this.injector.Resolve <IMetricServer>();
            this.metricServer.Start(7070);
        }