Exemplo n.º 1
0
        protected override void Update(GameTime gameTime)
        {
            if (Profiler.InContext("OutOfContext"))
            {
                Profiler.ExitContext("OutOfContext");
            }
            Profiler.EnterContext("Update");

            IsFixedTimeStep = Settings.Game.IsFixedTimeStep;

            if (!IsRunning)
            {
                Settings.Save();
                Exit();
            }
            else
            {
                base.Update(gameTime);
                double totalMS = gameTime.TotalGameTime.TotalMilliseconds;
                double frameMS = gameTime.ElapsedGameTime.TotalMilliseconds;

                TotalMS = totalMS;
                Input.Update(totalMS, frameMS);
                UserInterface.Update(totalMS, frameMS);
                if (Network.IsConnected)
                {
                    Network.Slice();
                }
                ActiveModel.Update(totalMS, frameMS);
            }

            Profiler.ExitContext("Update");
            Profiler.EnterContext("OutOfContext");
        }
Exemplo n.º 2
0
        protected override void Update(GameTime gameTime)
        {
            IsFixedTimeStep = Settings.Game.IsFixedTimeStep;

            if (!EngineVars.EngineRunning)
            {
                Settings.Save();
                Exit();
            }
            else
            {
                var totalMs = gameTime.TotalGameTime.TotalMilliseconds;
                var frameMs = gameTime.ElapsedGameTime.TotalMilliseconds;

                TotalMs = totalMs;
                Input.Update(totalMs, frameMs);
                UserInterface.Update(totalMs, frameMs);
                Network.Slice();
                ActiveModel.Update(totalMs, frameMs);
            }
        }