public void InitNet() { GenList.RemoveDuplicates(PipesThings); foreach (var thing in PipesThings) { Pipes.Add(thing.GetComp <CompPipe>()); GasPlant gasPlant = thing.TryGetComp <GasPlant>(); if (gasPlant != null) { GasPlants.Add(gasPlant); } CompGasCooler compGasCooler = thing.TryGetComp <CompGasCooler>(); if (compGasCooler != null) { GasCoolers.Add(compGasCooler); } CompGasTank compGasTank = thing.TryGetComp <CompGasTank>(); if (compGasTank != null) { GasTankers.Add(compGasTank); } } if (GasCoolers.Count > 0) { CanPush = true; } PipesThings.ForEach(x => x.GetComp <CompPipe>().NetInit()); }
public void PushGas(CompGasCooler cooler, float count) { if (Full) { return; } Storage += count; if (Storage > Props.StorageCapacity) { Storage = Props.StorageCapacity; count -= Storage - Props.StorageCapacity; } cooler.Storage -= count; }