public void StoreResource(IndustryResource resource) { if (stockpileMap.TryGetValue(resource.Key, out IndustryResource stock)) { stock.Amount += resource.Amount; return; } DVIndustry.ModEntry.Logger.Warning($"Tried to store a resource ({resource.AcceptedItems.ID}) that this industry doesn't use"); }
private static bool TryConvertResource(string key, float amount, out IndustryResource resource) { if (ResourceClass.TryParse(key, out ResourceClass rClass)) { resource = new IndustryResource(rClass, amount); return(true); } resource = null; DVIndustry.ModEntry.Logger.Critical($"Unrecognized resource class \"{key}\""); return(false); }