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(); }
public void PushWorker(RaceWorker worker) { Workers.Add(worker); InitializeWorker(worker); }