internal void OnSingleChainGenerated(JobChainController chain) { Main.Log("Single Chain with existing cars generated"); SingletonBehaviour <NetworkTrainManager> .Instance.SendNewJobChainCars(chain.trainCarsForJobChain); currentChains.Add(chain); OnJobsGenerated?.Invoke(station, new JobChainController[] { chain }); }
private IEnumerator WaitTillGenerationFinished() { while (station.ProceduralJobsController.IsJobGenerationActive) { yield return(new WaitUntil(() => !station.ProceduralJobsController.IsJobGenerationActive)); yield return(new WaitForSeconds(.25f)); } Main.Log("Generation is finished Length = " + newChains.Count); List <TrainCar> newJobTrains = new List <TrainCar>(); foreach (JobChainController job in newChains) { newJobTrains.AddRange(job.trainCarsForJobChain); } SingletonBehaviour <NetworkTrainManager> .Instance.SendNewJobChainCars(newJobTrains); OnJobsGenerated?.Invoke(station, newChains.ToArray()); newChains.Clear(); sendNewJobsAfterGeneration = null; }
internal void OnChainsGeneratedWithExistingCars(List <JobChainController> chains) { Main.Log("Multiple Chains with existing cars generated"); currentChains.AddRange(chains); OnJobsGenerated?.Invoke(station, chains.ToArray()); }
internal void OnSingleChainGeneratedWithExistingCars(JobChainController chain) { Main.Log("Single Chain with existing cars generated"); currentChains.Add(chain); OnJobsGenerated?.Invoke(station, new JobChainController[] { chain }); }