Example #1
0
        public void Update(GameTime deltaTime)
        {
            World.Update();
            for (int i = 0; i < World.Systems.Count; i++)
            {
                var preUpdateTicks = DateTime.UtcNow.Ticks;
                var system         = World.Systems[i];

                if (!system.WantsUpdate)
                {
                    continue;
                }
                if (system.IsActive)
                {
                    if (Global.Verbose)
                    {
                        FConsole.WriteLine("Update Starting for " + system.Name);
                    }

                    system.Update((float)deltaTime.ElapsedGameTime.TotalSeconds);

                    if (Global.Verbose)
                    {
                        FConsole.WriteLine("Done " + system.Name);
                    }
                }
                var postUpdateTicks = DateTime.UtcNow.Ticks;
                Profiler.AddUpdate(system.Name, (postUpdateTicks - preUpdateTicks) / 10000f);
            }
        }