Esempio n. 1
0
        private void InitializeWorker(RaceWorker worker)
        {
            worker.DelayProxy = (delayTime) => DelayProxy.Invoke(delayTime);
            TickProxy.Invoke(worker.OnRefreshState);
            TickProxy.Invoke(worker.OnGameLogicTick);
            TickProxy.Invoke(worker.OnGameRenderTick);

            TickProxy.Invoke(() =>
            {
                worker.ProcessGameTasks();
                return(DelayProxy.Invoke(100));
            });

            worker.OnWorkerInitialized();
        }
Esempio n. 2
0
 public void PushWorker(RaceWorker worker)
 {
     Workers.Add(worker);
     InitializeWorker(worker);
 }