public virtual ORSResourceManager createManagerForVessel(PartModule pm) { ORSResourceManager megamanager = new ORSResourceManager(pm, resource_name); managers.Add(pm.vessel, megamanager); return(megamanager); }
public double consumeFNResourcePerSecond(double power_per_second, String resourcename) { power_per_second = Math.Max(power_per_second, 0); ORSResourceManager manager = getManagerForVessel(resourcename, vessel); if (manager == null) { //UnityEngine.Debug.LogWarning("ORS - did not find manager for vessel"); return(0); } if (!fnresource_supplied.ContainsKey(resourcename)) { fnresource_supplied.Add(resourcename, 0); } double power_taken_per_second = Math.Max(Math.Min(power_per_second, fnresource_supplied[resourcename]), 0); fnresource_supplied[resourcename] -= power_taken_per_second; manager.powerDrawPerSecond(this, power_per_second, power_taken_per_second); return(power_taken_per_second); }
public double consumeFNResource(double power_fixed, String resourcename) { power_fixed = Math.Max(power_fixed, 0); ORSResourceManager manager = getManagerForVessel(resourcename, vessel); if (manager == null) { //UnityEngine.Debug.LogWarning("ORS - consumeFNResource did not find manager for vessel"); return(0); } if (!fnresource_supplied.ContainsKey(resourcename)) { fnresource_supplied.Add(resourcename, 0); } double power_taken_fixed = Math.Max(Math.Min(power_fixed, fnresource_supplied[resourcename] * TimeWarp.fixedDeltaTime), 0); fnresource_supplied[resourcename] -= power_taken_fixed / TimeWarp.fixedDeltaTime; manager.powerDrawFixed(this, power_fixed, power_taken_fixed); return(power_taken_fixed); }
public double getResourceBarRatio(String resourcename) { if (!getOvermanagerForResource(resourcename).hasManagerForVessel(vessel)) { return(0); } ORSResourceManager manager = getOvermanagerForResource(resourcename).getManagerForVessel(vessel); return(manager.getResourceBarRatio()); }
public float getCurrentUnfilledResourceDemand(String resourcename) { if (!getOvermanagerForResource(resourcename).hasManagerForVessel(vessel)) { return(0); } ORSResourceManager manager = getOvermanagerForResource(resourcename).getManagerForVessel(vessel); return(manager.getCurrentUnfilledResourceDemand()); }
public float GetPowerSupply(String resourcename) { if (!getOvermanagerForResource(resourcename).hasManagerForVessel(vessel)) { return(0); } ORSResourceManager manager = getOvermanagerForResource(resourcename).getManagerForVessel(vessel); return(manager.GetPowerSupply()); }
public double GetCurrentResourceDemand(String resourcename) { if (!getOvermanagerForResource(resourcename).hasManagerForVessel(vessel)) { return(0); } ORSResourceManager manager = getOvermanagerForResource(resourcename).getManagerForVessel(vessel); return(manager.GetCurrentRresourceDemand()); }
public float GetRequiredResourceDemand(String resourcename) { if (!getOvermanagerForResource(resourcename).hasManagerForVessel(vessel)) { return(0); } ORSResourceManager manager = getOvermanagerForResource(resourcename).getManagerForVessel(vessel); return(manager.GetRequiredResourceDemand()); }
public double getTotalResourceCapacity(String resourcename) { ORSResourceManager manager = getManagerForVessel(resourcename); if (manager == null) { return(0); } return(manager.getTotalResourceCapacity()); }
public double getResourceAvailability(String resourcename) { ORSResourceManager manager = getManagerForVessel(resourcename); if (manager == null) { return(0); } return(manager.getResourceAvailability()); }
public double getResourceBarRatio(String resourcename) { ORSResourceManager manager = getManagerForVessel(resourcename); if (manager == null) { return(0); } return(manager.ResourceBarRatio); }
public double GetCurrentResourceDemand(String resourcename) { ORSResourceManager manager = getManagerForVessel(resourcename); if (manager == null) { return(0); } return(manager.CurrentRresourceDemand); }
public double GetPowerSupply(String resourcename) { ORSResourceManager manager = getManagerForVessel(resourcename); if (manager == null) { return(0); } return(manager.PowerSupply); }
public double GetRequiredResourceDemand(String resourcename) { ORSResourceManager manager = getManagerForVessel(resourcename); if (manager == null) { return(0); } return(manager.GetRequiredResourceDemand()); }
public double getDemandStableSupply(String resourcename) { ORSResourceManager manager = getManagerForVessel(resourcename); if (manager == null) { return(0); } return(manager.getDemandStableSupply()); }
public double GetOverproduction(String resourcename) { ORSResourceManager manager = getManagerForVessel(resourcename); if (manager == null) { return(0); } return(manager.getOverproduction()); }
public double supplyFNResourcePerSecond(double supply, String resourcename) { ORSResourceManager manager = getManagerForVessel(resourcename); if (manager == null) { return(0); } return(manager.powerSupplyPerSecond(this, Math.Max(supply, 0))); }
public double getTotalResourceCapacity(String resourcename) { if (!getOvermanagerForResource(resourcename).hasManagerForVessel(vessel)) { return(0); } ORSResourceManager manager = getOvermanagerForResource(resourcename).getManagerForVessel(vessel); return(manager.getTotalResourceCapacity()); }
public double getDemandStableSupply(String resourcename) { if (!getOvermanagerForResource(resourcename).hasManagerForVessel(vessel)) { return(0); } ORSResourceManager manager = getOvermanagerForResource(resourcename).getManagerForVessel(vessel); return(manager.getDemandStableSupply()); }
public double supplyFNResourceFixedWithMax(double supply, double maxsupply, String resourcename) { ORSResourceManager manager = getManagerForVessel(resourcename); if (manager == null) { return(0); } return(manager.powerSupplyFixedWithMax(this, Math.Max(supply, 0), Math.Max(maxsupply, 0))); }
public double supplyFNResourcePerSecond(double supply, String resourcename) { ORSResourceManager manager = getManagerForVessel(resourcename, vessel); if (manager == null) { //UnityEngine.Debug.LogWarning("ORS - did not find manager for vessel"); return(0); } return(manager.powerSupplyPerSecond(this, Math.Max(supply, 0))); }
public double supplyManagedFNResourcePerSecondWithMinimumRatio(double supply, double ratio_min, String resourcename) { ORSResourceManager manager = getManagerForVessel(resourcename, vessel); if (manager == null) { UnityEngine.Debug.LogWarning("ORS - did not find manager for vessel"); return(0); } return(manager.managedPowerSupplyPerSecondWithMinimumRatio(this, Math.Max(supply, 0), Math.Max(ratio_min, 0))); }
public double GetPowerSupply(String resourcename) { ORSResourceManager manager = getManagerForVessel(resourcename, vessel); if (manager == null) { UnityEngine.Debug.LogWarning("ORS - did not find manager for vessel"); return(0); } return(manager.PowerSupply); }
public void RemoveItselfAsManager() { foreach (String resourcename in resources_to_supply) { ORSResourceManager resource_manager = getOvermanagerForResource(resourcename).getManagerForVessel(vessel); if (resource_manager != null && resource_manager.PartModule == this) { resource_manager.updatePartModule(null); } } }
public double getTotalResourceCapacity(String resourcename) { ORSResourceManager manager = getManagerForVessel(resourcename, vessel); if (manager == null) { UnityEngine.Debug.LogWarning("ORS - did not find manager for vessel"); return(0); } return(manager.getTotalResourceCapacity()); }
public double getResourceBarRatio(String resourcename) { ORSResourceManager manager = getManagerForVessel(resourcename, vessel); if (manager == null) { //UnityEngine.Debug.LogWarning("ORS - getResourceBarRatio did not find manager for vessel"); return(0); } return(manager.ResourceBarRatio); }
public double GetCurrentResourceDemand(String resourcename) { ORSResourceManager manager = getManagerForVessel(resourcename, vessel); if (manager == null) { UnityEngine.Debug.LogWarning("ORS - did not find manager for vessel"); return(0); } return(manager.CurrentRresourceDemand); }
public double supplyManagedFNResource(double supply, String resourcename) { supply = Math.Max(supply, 0); if (!getOvermanagerForResource(resourcename).hasManagerForVessel(vessel)) { return(0); } ORSResourceManager manager = getOvermanagerForResource(resourcename).getManagerForVessel(vessel); return(manager.managedPowerSupply(this, supply)); }
public double GetOverproduction(String resourcename) { ORSResourceManager manager = getManagerForVessel(resourcename, vessel); if (manager == null) { UnityEngine.Debug.LogWarning("ORS - did not find manager for vessel"); return(0); } return(manager.getOverproduction()); }
public double supplyFNResourceFixedMax(double supply, double maxsupply, String resourcename) { supply = Math.Max(supply, 0); maxsupply = Math.Max(maxsupply, 0); if (!getOvermanagerForResource(resourcename).hasManagerForVessel(vessel)) { return(0); } ORSResourceManager manager = getOvermanagerForResource(resourcename).getManagerForVessel(vessel); return(manager.powerSupplyFixedMax(this, supply, maxsupply)); }
public void deleteManager(ORSResourceManager manager) { managers.Remove(manager.getVessel()); }
public virtual ORSResourceManager createManagerForVessel(PartModule pm) { ORSResourceManager megamanager = new ORSResourceManager(pm, resource_name); managers.Add(pm.vessel, megamanager); return megamanager; }