예제 #1
0
        public AudioApplication(GlobalWorld source, Context overrideContext) : base(source, overrideContext)
        {
            targetFrequency = TimeSpan.FromSeconds(1f / 500f);
            timeApp         = new TimeApp(Data.Context);
            fts             = new FixedTimeStep {
                TargetFrameTimeMs = (int)targetFrequency.TotalMilliseconds
            };

            worker = new ApplicationWorker("Audio");
        }
예제 #2
0
        private static void SetTimer()
        {
            // Run();
            aTimer           = new System.Timers.Timer(300000);
            aTimer.Elapsed  += OnTimedEvent;
            aTimer.AutoReset = true;
            aTimer.Enabled   = true;

            ApplicationWorker applicationWorker = new ApplicationWorker(exitLocker);

            applicationWorker.Run();

            aTimer.Start();
        }
예제 #3
0
        public SimulationApplication(GlobalWorld source, Context overrideContext) : base(source, overrideContext)
        {
            // register game world since it's kinda important for the simu app, ahah
            Data.Context.BindExisting(gameWorld = new GameWorld());
            Data.Context.BindExisting <IBatchRunner>(batchRunner = new ThreadBatchRunner(0.5f)); // we only use 50% of the cores

            targetFrequency = TimeSpan.FromSeconds(0.02);                                        // 100 fps
            timeApp         = new TimeApp(Data.Context);
            fts             = new FixedTimeStep {
                TargetFrameTimeMs = (int)targetFrequency.TotalMilliseconds
            };

            worker = new ApplicationWorker("Simulation");
        }
예제 #4
0
        private static void OnTimedEvent(Object source, ElapsedEventArgs e)
        {
            ApplicationWorker applicationWorker = new ApplicationWorker(exitLocker);

            applicationWorker.Run();
        }