Пример #1
0
    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 });
    }
Пример #2
0
    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;
    }
Пример #3
0
 internal void OnChainsGeneratedWithExistingCars(List <JobChainController> chains)
 {
     Main.Log("Multiple Chains with existing cars generated");
     currentChains.AddRange(chains);
     OnJobsGenerated?.Invoke(station, chains.ToArray());
 }
Пример #4
0
 internal void OnSingleChainGeneratedWithExistingCars(JobChainController chain)
 {
     Main.Log("Single Chain with existing cars generated");
     currentChains.Add(chain);
     OnJobsGenerated?.Invoke(station, new JobChainController[] { chain });
 }