public double GetCurrentSurplus(String resourcename) { if (String.IsNullOrEmpty(resourcename)) { Debug.LogError("[KSPI]: GetOverproduction resourcename is null or empty"); return(0); } ResourceManager manager = getManagerForVessel(resourcename); if (manager == null) { //Debug.LogError("[KSPI]: failed to find resource Manager For Current Vessel"); return(0); } return(manager.getCurrentSurplus()); }