public JournalMaterialDiscarded(JObject evt) : base(evt, JournalTypeEnum.MaterialDiscarded)
 {
     Category     = evt["Category"].Str();
     Name         = evt["Name"].Str();   // FDNAME
     FriendlyName = JournalFieldNaming.RMat(Name);
     Count        = evt["Count"].Int();
 }
 public JournalMiningRefined(JObject evt) : base(evt, JournalTypeEnum.MiningRefined)
 {
     Type           = JournalFieldNaming.FixCommodityName(evt["Type"].Str()); // instances of $.._name, translate to FDNAME
     Type           = JournalFieldNaming.FDNameTranslation(Type);             // pre-mangle to latest names, in case we are reading old journal records
     FriendlyType   = JournalFieldNaming.RMat(Type);
     Type_Localised = evt["Type_Localised"].Str().Alt(FriendlyType);
 }
        public JournalEngineerContribution(JObject evt) : base(evt, JournalTypeEnum.EngineerContribution)
        {
            Engineer = evt["Engineer"].Str();
            Type     = evt["Type"].Str();

            if (Type.Equals("Commodity") || Type.Equals("Materials"))
            {
                unknownType = false;
            }
            else
            {
                unknownType = true;
            }

            Commodity         = evt["Commodity"].Str();
            Commodity         = JournalFieldNaming.FDNameTranslation(Commodity); // pre-mangle to latest names, in case we are reading old journal records
            FriendlyCommodity = JournalFieldNaming.RMat(Commodity);

            Material         = evt["Material"].Str();
            Material         = JournalFieldNaming.FDNameTranslation(Material); // pre-mangle to latest names, in case we are reading old journal records
            FriendlyMaterial = JournalFieldNaming.RMat(Material);

            Quantity      = evt["Quantity"].Int();
            TotalQuantity = evt["TotalQuantity"].Int();
        }
Пример #4
0
 public void Normalise()
 {
     Material           = JournalFieldNaming.FDNameTranslation(Material);
     FriendlyMaterial   = JournalFieldNaming.RMat(Material);
     Material_Localised = Material_Localised.Alt(FriendlyMaterial);       // ensure.
     Category_Localised = Category_Localised.Alt(Category);
 }
Пример #5
0
 public JournalMaterialDiscovered(JObject evt) : base(evt, JournalTypeEnum.MaterialDiscovered)
 {
     Category        = evt["Category"].Str();
     Name            = evt["Name"].Str();
     FriendlyName    = JournalFieldNaming.RMat(Name);
     DiscoveryNumber = evt["DiscoveryNumber"].Int();
 }
Пример #6
0
        public override void FillInformation(out string summary, out string info, out string detailed) //V
        {
            summary = EventTypeStr.SplitCapsWord();
            info    = "";
            bool comma = false;

            if (Materials != null)
            {
                foreach (MaterialItem m in Materials.Materials)
                {
                    if (comma)
                    {
                        info += ", ";
                    }
                    comma = true;
                    info += BaseUtils.FieldBuilder.Build("Name:", JournalFieldNaming.RMat(m.Name), "", m.Count);
                }
            }

            if (Commodities != null)
            {
                foreach (CommodityItem m in Commodities.Commodities)
                {
                    if (comma)
                    {
                        info += ", ";
                    }
                    comma = true;
                    info += BaseUtils.FieldBuilder.Build("Name:", JournalFieldNaming.RMat(m.Name), "", m.Count);
                }
            }
            detailed = "";
        }
        public JournalMissionAccepted(JObject evt) : base(evt, JournalTypeEnum.MissionAccepted)
        {
            Faction = evt["Faction"].Str();
            Name    = JournalFieldNaming.GetBetterMissionName(evt["Name"].Str());

            TargetType          = evt["TargetType"].Str();
            TargetTypeFriendly  = JournalFieldNaming.GetBetterTargetTypeName(TargetType);   // remove $, underscore it
            TargetTypeLocalised = evt["TargetType_Localised"].Str();
            TargetFaction       = evt["TargetFaction"].Str();
            Target          = evt["Target"].Str();
            TargetFriendly  = JournalFieldNaming.GetBetterTargetTypeName(Target);                                       // remove $, underscore it
            TargetLocalised = evt["Target_localised"].Str();                                                            // not all

            DestinationSystem  = evt["DestinationSystem"].Str().Replace("$MISSIONUTIL_MULTIPLE_INNER_SEPARATOR;", ","); // multi missions get this strange list;
            DestinationStation = evt["DestinationStation"].Str();

            Influence  = evt["Influence"].Str();
            Reputation = evt["Reputation"].Str();

            MissionId = evt["MissionID"].Int();

            Commodity          = JournalFieldNaming.FixCommodityName(evt["Commodity"].Str()); // instances of $_name, fix to fdname
            CommodityLocalised = evt["Commodity_Localised"].Str();
            FriendlyCommodity  = JournalFieldNaming.RMat(Commodity);

            Count  = evt["Count"].IntNull();
            Expiry = evt["Expiry"].DateTimeUTC();

            PassengerCount  = evt["PassengerCount"].IntNull();
            PassengerVIPs   = evt["PassengerVIPs"].BoolNull();
            PassengerWanted = evt["PassengerWanted"].BoolNull();
            PassengerType   = evt["PassengerType"].StrNull();

            Reward = evt["Reward"].IntNull();   // not in DOC V13, but present in latest journal entries
        }
Пример #8
0
 public JournalMaterialDiscarded(JObject evt) : base(evt, JournalTypeEnum.MaterialDiscarded)
 {
     Category     = JournalFieldNaming.NormaliseMaterialCategory(evt["Category"].Str());
     Name         = JournalFieldNaming.FDNameTranslation(evt["Name"].Str()); // pre-mangle to latest names, in case we are reading old journal records
     FriendlyName = JournalFieldNaming.RMat(Name);
     Count        = evt["Count"].Int();
 }
 public JournalCollectCargo(JObject evt) : base(evt, JournalTypeEnum.CollectCargo)
 {
     Type         = evt["Type"].Str();                          //FDNAME
     Type         = JournalFieldNaming.FDNameTranslation(Type); // pre-mangle to latest names, in case we are reading old journal records
     FriendlyType = JournalFieldNaming.RMat(Type);
     Stolen       = evt["Stolen"].Bool();
 }
Пример #10
0
        public override void FillInformation(out string summary, out string info, out string detailed) //V
        {
            summary  = EventTypeStr.SplitCapsWord();
            info     = "No Cargo";
            detailed = "";

            if (Inventory != null && Inventory.Length > 0)
            {
                int total = 0;
                foreach (Cargo c in Inventory)
                {
                    total += c.Count;
                }

                info     = "Cargo, " + total + " items";
                detailed = "";

                foreach (Cargo c in Inventory)
                {
                    if (detailed.Length > 0)
                    {
                        detailed += Environment.NewLine;
                    }
                    int?stolen = null;
                    if (c.Stolen > 0)
                    {
                        stolen = c.Stolen;
                    }
                    detailed += BaseUtils.FieldBuilder.Build("", JournalFieldNaming.RMat(c.Name), "; items", c.Count, "(;)", stolen);
                }
            }
        }
Пример #11
0
 public JournalMaterialCollected(JObject evt) : base(evt, JournalTypeEnum.MaterialCollected)
 {
     Category     = evt["Category"].Str();
     Name         = evt["Name"].Str();                          // MUST BE FD NAME
     Name         = JournalFieldNaming.FDNameTranslation(Name); // pre-mangle to latest names, in case we are reading old journal records
     FriendlyName = JournalFieldNaming.RMat(Name);
     Count        = evt["Count"].Int(1);
 }
Пример #12
0
 public JournalEjectCargo(JObject evt) : base(evt, JournalTypeEnum.EjectCargo)
 {
     Type            = evt["Type"].Str();
     FriendlyType    = JournalFieldNaming.RMat(Type);
     Count           = evt["Count"].Int();
     Abandoned       = evt["Abandoned"].Bool();
     PowerplayOrigin = evt["PowerplayOrigin"].Str();
 }
Пример #13
0
 public JournalSearchAndRescue(JObject evt) : base(evt, JournalTypeEnum.SearchAndRescue)
 {
     Name         = evt["Name"].Str();
     Name         = JournalFieldNaming.FDNameTranslation(Name); // some premangling
     FriendlyName = JournalFieldNaming.RMat(Name);
     Count        = evt["Count"].Int();
     Reward       = evt["Reward"].Long();
 }
Пример #14
0
 public JournalMarketBuy(JObject evt) : base(evt, JournalTypeEnum.MarketBuy)
 {
     Type         = evt["Type"].Str(); // must be FD name
     FriendlyType = JournalFieldNaming.RMat(Type);
     Count        = evt["Count"].Int();
     BuyPrice     = evt["BuyPrice"].Long();
     TotalCost    = evt["TotalCost"].Long();
 }
Пример #15
0
 public JournalMarketBuy(JObject evt) : base(evt, JournalTypeEnum.MarketBuy)
 {
     Type         = evt["Type"].Str();                          // must be FD name
     Type         = JournalFieldNaming.FDNameTranslation(Type); // pre-mangle to latest names, in case we are reading old journal records
     FriendlyType = JournalFieldNaming.RMat(Type);
     Count        = evt["Count"].Int();
     BuyPrice     = evt["BuyPrice"].Long();
     TotalCost    = evt["TotalCost"].Long();
 }
Пример #16
0
 public JournalEjectCargo(JObject evt) : base(evt, JournalTypeEnum.EjectCargo)
 {
     Type            = evt["Type"].Str();                          // fdname
     Type            = JournalFieldNaming.FDNameTranslation(Type); // pre-mangle to latest names, in case we are reading old journal records
     FriendlyType    = JournalFieldNaming.RMat(Type);
     Count           = evt["Count"].Int();
     Abandoned       = evt["Abandoned"].Bool();
     PowerplayOrigin = evt["PowerplayOrigin"].Str();
 }
Пример #17
0
        public JournalMissionCompleted(JObject evt) : base(evt, JournalTypeEnum.MissionCompleted)
        {
            FDName  = evt["Name"].Str();
            Name    = JournalFieldNaming.GetBetterMissionName(FDName);
            Faction = evt["Faction"].Str();

            Commodity          = JournalFieldNaming.FixCommodityName(evt["Commodity"].Str()); // evidence of $_name problem, fix to fdname
            Commodity          = JournalFieldNaming.FDNameTranslation(Commodity);             // pre-mangle to latest names, in case we are reading old journal records
            FriendlyCommodity  = JournalFieldNaming.RMat(Commodity);
            CommodityLocalised = evt["Commodity_Localised"].Str().Alt(FriendlyCommodity);

            Count = evt["Count"].IntNull();

            TargetType          = evt["TargetType"].Str();
            TargetTypeFriendly  = JournalFieldNaming.GetBetterTargetTypeName(TargetType);       // remove $, underscores etc
            TargetTypeLocalised = evt["TargetTypeLocalised"].Str().Alt(TargetTypeFriendly);     // may be empty..

            TargetFaction = evt["TargetFaction"].Str();

            Target          = evt["Target"].Str();
            TargetFriendly  = JournalFieldNaming.GetBetterTargetTypeName(Target);       // remove $, underscores etc
            TargetLocalised = evt["Target_Localised"].Str().Alt(TargetFriendly);        // copied from Accepted.. no evidence

            Reward    = evt["Reward"].LongNull();
            Donation  = evt["Donation"].LongNull();
            MissionId = evt["MissionID"].Int();

            DestinationSystem  = evt["DestinationSystem"].Str().Replace("$MISSIONUTIL_MULTIPLE_INNER_SEPARATOR;", ",");      // multi missions get this strange list
            DestinationStation = evt["DestinationStation"].Str();

            PermitsAwarded = evt["PermitsAwarded"]?.ToObjectProtected <string[]>();

            // 7/3/2018 journal 16 3.02

            CommodityReward = evt["CommodityReward"]?.ToObjectProtected <CommodityRewards[]>();

            if (CommodityReward != null)
            {
                foreach (CommodityRewards c in CommodityReward)
                {
                    c.Normalise();
                }
            }

            MaterialsReward = evt["MaterialsReward"]?.ToObjectProtected <MaterialRewards[]>();

            if (MaterialsReward != null)
            {
                foreach (MaterialRewards m in MaterialsReward)
                {
                    m.Normalise();
                }
            }

            FactionEffects = evt["FactionEffects"]?.ToObjectProtected <FactionEffectsEntry[]>();      // NEEDS TEST
        }
Пример #18
0
        public string List(Material[] mat)
        {
            StringBuilder sb = new StringBuilder(64);

            foreach (Material m in mat)
            {
                sb.Append(Environment.NewLine);
                sb.Append(BaseUtils.FieldBuilder.Build(" ", JournalFieldNaming.RMat(m.Name), "; items", m.Count));
            }
            return(sb.ToString());
        }
        public JournalMissionCompleted(JObject evt) : base(evt, JournalTypeEnum.MissionCompleted)
        {
            Name    = JournalFieldNaming.GetBetterMissionName(evt["Name"].Str());
            Faction = evt["Faction"].Str();

            Commodity          = JournalFieldNaming.FixCommodityName(evt["Commodity"].Str()); // evidence of $_name problem, fix to fdname
            Commodity          = JournalFieldNaming.FDNameTranslation(Commodity);             // pre-mangle to latest names, in case we are reading old journal records
            CommodityLocalised = evt["Commodity_Localised"].Str();
            FriendlyCommodity  = JournalFieldNaming.RMat(Commodity);

            Count = evt["Count"].IntNull();

            TargetType          = evt["TargetType"].Str();
            TargetTypeFriendly  = JournalFieldNaming.GetBetterTargetTypeName(TargetType); // remove $, underscores etc
            TargetTypeLocalised = evt["TargetTypeLocalised"].Str();                       // may be empty..
            TargetFaction       = evt["TargetFaction"].Str();
            Target          = evt["Target"].Str();
            TargetFriendly  = JournalFieldNaming.GetBetterTargetTypeName(Target); // remove $, underscores etc
            TargetLocalised = evt["Target_Localised"].Str();                      // copied from Accepted.. no evidence

            Reward    = evt["Reward"].LongNull();
            Donation  = evt["Donation"].LongNull();
            MissionId = evt["MissionID"].Int();

            DestinationSystem  = evt["DestinationSystem"].Str().Replace("$MISSIONUTIL_MULTIPLE_INNER_SEPARATOR;", ",");      // multi missions get this strange list
            DestinationStation = evt["DestinationStation"].Str();

            if (!evt["PermitsAwarded"].Empty())
            {
                PermitsAwarded = evt.Value <JArray>("PermitsAwarded").Values <string>().ToArray();
            }

            if (!evt["CommodityReward"].Empty())
            {
                JArray rewards = (JArray)evt["CommodityReward"];        // does not have the $_name problem, straight FDNAME

                if (rewards.Count > 0)
                {
                    System.Tuple <string, int>[] cr = new System.Tuple <string, int> [rewards.Count];
                    int i = 0;
                    foreach (JToken jc in rewards.Children())
                    {
                        if (!jc["Name"].Empty() && !jc["Count"].Empty())        // evidence of empty values
                        {
                            cr[i++] = new System.Tuple <string, int>(JournalFieldNaming.FDNameTranslation(jc["Name"].Value <string>()), jc["Count"].Value <int>());
                        }

                        //System.Diagnostics.Trace.WriteLine(string.Format(" >> Child {0} {1}", jc.Path, jc.Type.ToString()));
                    }
                    CommodityReward = new System.Tuple <string, int> [i];
                    System.Array.Copy(cr, CommodityReward, i);
                }
            }
        }
 public JournalMarketBuy(JObject evt) : base(evt, JournalTypeEnum.MarketBuy)
 {
     MarketID       = evt["MarketID"].LongNull();
     Type           = evt["Type"].Str();                             // must be FD name
     Type           = JournalFieldNaming.FDNameTranslation(Type);    // pre-mangle to latest names, in case we are reading old journal records
     FriendlyType   = JournalFieldNaming.RMat(Type);                 // our translation..
     Type_Localised = evt["Type_Localised"].Str().Alt(FriendlyType); // always ensure we have one
     Count          = evt["Count"].Int();
     BuyPrice       = evt["BuyPrice"].Long();
     TotalCost      = evt["TotalCost"].Long();
 }
            public void Normalise()
            {
                Material           = JournalFieldNaming.FDNameTranslation(Material);
                FriendlyMaterial   = JournalFieldNaming.RMat(Material);
                Material_Localised = Material_Localised.Alt(FriendlyMaterial);                   // ensure.

                if (Category != null)                                                            // some entries do not have this
                {
                    Category           = JournalFieldNaming.NormaliseMaterialCategory(Category); // fix up any strangeness
                    Category_Localised = Category_Localised.Alt(Category);
                }
            }
Пример #22
0
 public JournalMarketSell(JObject evt) : base(evt, JournalTypeEnum.MarketSell)
 {
     Type         = evt["Type"].Str();                   // FDNAME
     FriendlyType = JournalFieldNaming.RMat(Type);
     Count        = evt["Count"].Int();
     SellPrice    = evt["SellPrice"].Long();
     TotalSale    = evt["TotalSale"].Long();
     AvgPricePaid = evt["AvgPricePaid"].Long();
     IllegalGoods = evt["IllegalGoods"].Bool();
     StolenGoods  = evt["StolenGoods"].Bool();
     BlackMarket  = evt["BlackMarket"].Bool();
 }
Пример #23
0
            public void Normalise()
            {
                Name           = JournalFieldNaming.FDNameTranslation(Name);
                FriendlyName   = JournalFieldNaming.RMat(Name);
                Name_Localised = Name_Localised.Alt(FriendlyName);

                if (Category != null)
                {
                    Category           = JournalFieldNaming.NormaliseMaterialCategory(Category);
                    Category_Localised = Category_Localised.Alt(Category);
                }
            }
Пример #24
0
 public JournalMarketSell(JObject evt) : base(evt, JournalTypeEnum.MarketSell)
 {
     Type         = evt["Type"].Str();                          // FDNAME
     Type         = JournalFieldNaming.FDNameTranslation(Type); // pre-mangle to latest names, in case we are reading old journal records
     FriendlyType = JournalFieldNaming.RMat(Type);
     Count        = evt["Count"].Int();
     SellPrice    = evt["SellPrice"].Long();
     TotalSale    = evt["TotalSale"].Long();
     AvgPricePaid = evt["AvgPricePaid"].Long();
     IllegalGoods = evt["IllegalGoods"].Bool();
     StolenGoods  = evt["StolenGoods"].Bool();
     BlackMarket  = evt["BlackMarket"].Bool();
 }
        public override void FillInformation(out string info, out string detailed) //V
        {
            info = Name;
            if (Materials != null)
            {
                foreach (KeyValuePair <string, int> k in Materials)
                {
                    info += ", " + JournalFieldNaming.RMat(k.Key) + ":" + k.Value.ToString();
                }
            }

            detailed = "";
        }
Пример #26
0
        public override void FillInformation(out string info, out string detailed) //V
        {
            info = BaseUtils.FieldBuilder.Build("In ", Slot, "", Module, "By ", Engineering.Engineer, "Blueprint ", Engineering.FriendlyBlueprintName, "Level ", Engineering.Level);

            detailed = "";
            if (Ingredients != null)
            {
                foreach (KeyValuePair <string, int> k in Ingredients)        // may be commodities or materials
                {
                    detailed += BaseUtils.FieldBuilder.Build("", JournalFieldNaming.RMat(k.Key), "", k.Value) + "; ";
                }
            }
        }
Пример #27
0
        public override void FillInformation(out string summary, out string info, out string detailed) //V
        {
            summary = EventTypeStr.SplitCapsWord();
            info    = BaseUtils.FieldBuilder.Build("", Engineer, "Blueprint:", Blueprint, "Level:", Level);

            detailed = "";
            if (Ingredients != null)
            {
                foreach (KeyValuePair <string, int> k in Ingredients)        // may be commodities or materials
                {
                    detailed += BaseUtils.FieldBuilder.Build("Name:", JournalFieldNaming.RMat(k.Key), "", k.Value) + "; ";
                }
            }
        }
        public string CommoditiesList()
        {
            string detailed = "";

            if (CommodityReward != null && CommodityReward.Length > 0)
            {
                detailed += "Rewards:";
                for (int i = 0; i < CommodityReward.Length; i++)
                {
                    detailed += ((i > 0) ? "," : "") + JournalFieldNaming.RMat(CommodityReward[i].Item1) + " " + CommodityReward[i].Item2.ToStringInvariant();
                }

                detailed += System.Environment.NewLine;
            }
            return(detailed);
        }
Пример #29
0
 public JournalCargoDepot(JObject evt) : base(evt, JournalTypeEnum.CargoDepot)
 {
     MissionId  = evt["MissionID"].Int();
     UpdateType = evt["UpdateType"].Str();        // must be FD name
     System.Enum.TryParse <UpdateTypeEnum>(UpdateType, out UpdateTypeEnum u);
     UpdateEnum          = u;
     CargoType           = evt["CargoType"].Str(); // item counts
     FriendlyCargoType   = JournalFieldNaming.RMat(CargoType);
     Count               = evt["Count"].Int(0);
     StartMarketID       = evt["StartMarketID"].Long();
     EndMarketID         = evt["EndMarketID"].Long();
     ItemsCollected      = evt["ItemsCollected"].Int();
     ItemsDelivered      = evt["ItemsCollected"].Int();
     TotalItemsToDeliver = evt["TotalItemsToDeliver"].Int();
     ProgressPercent     = evt["Progress"].Double() * 100;
     MarketID            = evt["MarketID"].LongNull();
 }
        public JournalTechnologyBroker(JObject evt) : base(evt, JournalTypeEnum.TechnologyBroker)
        {
            BrokerType = evt["BrokerType"].Str("Unknown");
            MarketID   = evt["MarketID"].LongNull();

            ItemsUnlocked = evt["ItemsUnlocked"]?.ToObjectProtected <Unlocked[]>();      //3.03 entry
            CommodityList = evt["Commodities"]?.ToObjectProtected <Commodities[]>();
            MaterialList  = evt["Materials"]?.ToObjectProtected <Materials[]>();

            if (ItemsUnlocked != null)
            {
                foreach (Unlocked u in ItemsUnlocked)
                {
                    u.Name_Localised = u.Name_Localised.Alt(u.Name);
                }
            }

            if (CommodityList != null)
            {
                foreach (Commodities c in CommodityList)
                {
                    c.FriendlyName = JournalFieldNaming.RMat(c.Name);
                }
            }

            if (MaterialList != null)
            {
                foreach (Materials m in MaterialList)
                {
                    m.FriendlyName = JournalFieldNaming.RMat(m.Name);
                    m.Category     = JournalFieldNaming.NormaliseMaterialCategory(m.Category);
                }
            }

            string oldentry = evt["ItemUnlocked"].StrNull();        // 3.02 journal entry

            if (ItemsUnlocked == null && oldentry != null)
            {
                ItemsUnlocked = new Unlocked[] { new Unlocked()
                                                 {
                                                     Name = oldentry, Name_Localised = oldentry
                                                 } }
            }
            ;
        }