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