/// <summary> /// Applied after AddItem runs. /// </summary> internal static void Postfix(FlowUtilityNetwork __instance, object generic_item) { if (generic_item is FlowUtilityNetwork.IItem conduit && conduit.EndpointType == Endpoint.Conduit) { __instance.conduits.Add(conduit); } }
public override string GetProgress(bool complete) { float num = 0f; IUtilityNetworkMgr networkManager = Conduit.GetNetworkManager(ConduitType.Gas); foreach (UtilityNetwork network in networkManager.GetNetworks()) { FlowUtilityNetwork flowUtilityNetwork = network as FlowUtilityNetwork; if (flowUtilityNetwork != null) { foreach (FlowUtilityNetwork.IItem sink in flowUtilityNetwork.sinks) { Vent component = sink.GameObject.GetComponent <Vent>(); if ((Object)component != (Object)null) { num += component.GetVentedMass(element); } } } } return(string.Format(COLONY_ACHIEVEMENTS.MISC_REQUIREMENTS.STATUS.VENTED_MASS, GameUtil.GetFormattedMass((!complete) ? num : kilogramsToVent, GameUtil.TimeSlice.None, GameUtil.MetricMassFormat.Kilogram, true, "{0:0.#}"), GameUtil.GetFormattedMass(kilogramsToVent, GameUtil.TimeSlice.None, GameUtil.MetricMassFormat.Kilogram, true, "{0:0.#}"))); }
public override bool Success() { float num = 0f; IUtilityNetworkMgr networkManager = Conduit.GetNetworkManager(ConduitType.Gas); foreach (UtilityNetwork network in networkManager.GetNetworks()) { FlowUtilityNetwork flowUtilityNetwork = network as FlowUtilityNetwork; if (flowUtilityNetwork != null) { foreach (FlowUtilityNetwork.IItem sink in flowUtilityNetwork.sinks) { Vent component = sink.GameObject.GetComponent <Vent>(); if ((Object)component != (Object)null) { num += component.GetVentedMass(element); } } } } return(num >= kilogramsToVent); }
/// <summary> /// Applied before Reset runs. /// </summary> internal static void Prefix(FlowUtilityNetwork __instance) { __instance.conduits.Clear(); }