예제 #1
0
        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);
            }
        }
예제 #2
0
        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);
            }
        }
예제 #3
0
        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);
            }
        }