public void UpdateMicroResource(MaterialCommoditiesMicroResourceList mc, JournalEntry unused) // update all ship locker materials to these values { if (Items != null) { List <Tuple <string, int> > counts = Items.Select(x => new Tuple <string, int>(x.Name, x.Count)).ToList(); mc.Update(EventTimeUTC, MaterialCommodityMicroResourceType.CatType.Item, counts, MicroResource.ShipLocker); } if (Components != null) { List <Tuple <string, int> > counts = Components.Select(x => new Tuple <string, int>(x.Name, x.Count)).ToList(); mc.Update(EventTimeUTC, MaterialCommodityMicroResourceType.CatType.Component, counts, MicroResource.ShipLocker); } if (Consumables != null) { List <Tuple <string, int> > counts = Consumables.Select(x => new Tuple <string, int>(x.Name, x.Count)).ToList(); mc.Update(EventTimeUTC, MaterialCommodityMicroResourceType.CatType.Consumable, counts, MicroResource.ShipLocker); } if (Data != null) { List <Tuple <string, int> > counts = Data.Select(x => new Tuple <string, int>(x.Name, x.Count)).ToList(); mc.Update(EventTimeUTC, MaterialCommodityMicroResourceType.CatType.Data, counts, MicroResource.ShipLocker); } }
public void UpdateMicroResource(MaterialCommoditiesMicroResourceList mc, JournalEntry unused) { if (Items != null) { List <Tuple <string, int> > counts = Items.Select(x => new Tuple <string, int>(x.Name, x.Count)).ToList(); // Name is already lower cased mc.Update(EventTimeUTC, MaterialCommodityMicroResourceType.CatType.Item, counts, MicroResource.BackPack); } if (Components != null) { List <Tuple <string, int> > counts = Components.Select(x => new Tuple <string, int>(x.Name, x.Count)).ToList(); mc.Update(EventTimeUTC, MaterialCommodityMicroResourceType.CatType.Component, counts, MicroResource.BackPack); } if (Consumables != null) { List <Tuple <string, int> > counts = Consumables.Select(x => new Tuple <string, int>(x.Name, x.Count)).ToList(); mc.Update(EventTimeUTC, MaterialCommodityMicroResourceType.CatType.Consumable, counts, MicroResource.BackPack); } if (Data != null) { List <Tuple <string, int> > counts = Data.Select(x => new Tuple <string, int>(x.Name, x.Count)).ToList(); mc.Update(EventTimeUTC, MaterialCommodityMicroResourceType.CatType.Data, counts, MicroResource.BackPack); } }
public override void FillInformation(ISystem sys, out string info, out string detailed) { info = ""; detailed = ""; if (Items != null && Items.Length > 0) { if (Items.Length > 10) { info = BaseUtils.FieldBuilder.Build("Items".T(EDTx.JournalMicroResources_Items) + ": ; ", Items.Length); } detailed = "Items".T(EDTx.JournalMicroResources_Items) + ": " + MicroResource.List(Items) + Environment.NewLine; } if (Components != null && Components.Length > 0) { info = info.AppendPrePad(BaseUtils.FieldBuilder.Build("Components".T(EDTx.JournalMicroResources_Components) + ": ; ", Components.Length), "; "); detailed += "Components".T(EDTx.JournalMicroResources_Components) + ": " + MicroResource.List(Components) + Environment.NewLine; } if (Consumables != null && Consumables.Length > 0) { if (Items.Length > 10) { info = info.AppendPrePad(BaseUtils.FieldBuilder.Build("Consumables".T(EDTx.JournalMicroResources_Consumables) + ": ; ", Consumables.Length), "; "); } else { info = info.AppendPrePad(string.Join(", ", Consumables.Select(x => x.FriendlyName).ToArray()), "; "); } detailed += "Consumables".T(EDTx.JournalMicroResources_Consumables) + ": " + MicroResource.List(Consumables) + Environment.NewLine; } if (Data != null && Data.Length > 0) { info = info.AppendPrePad(BaseUtils.FieldBuilder.Build("Data".T(EDTx.JournalMicroResources_Data) + ": ; ", Data.Length), "; "); detailed += "Data".T(EDTx.JournalMicroResources_Data) + ": " + MicroResource.List(Data); } }