Esempio n. 1
0
 public JournalMaterialDiscovered(JObject evt) : base(evt, JournalTypeEnum.MaterialDiscovered)
 {
     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    = MaterialCommodityData.GetNameByFDName(Name);
     DiscoveryNumber = evt["DiscoveryNumber"].Int();
 }
Esempio n. 2
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();
 }
Esempio n. 3
0
 public JournalMaterialCollected(JObject evt) : base(evt, JournalTypeEnum.MaterialCollected)
 {
     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 = MaterialCommodityMicroResourceType.GetNameByFDName(Name);
     Count        = evt["Count"].Int(1);
 }
 public JournalScientificResearch(JObject evt) : base(evt, JournalTypeEnum.ScientificResearch)
 {
     Name     = JournalFieldNaming.FDNameTranslation(evt["Name"].Str());
     Count    = evt["Count"].Int();
     Category = JournalFieldNaming.NormaliseMaterialCategory(evt["Category"].Str());
     MarketID = evt["MarketID"].LongNull();
 }
Esempio n. 5
0
            public void Normalise()
            {
                Name           = JournalFieldNaming.FDNameTranslation(Name);
                FriendlyName   = MaterialCommodityData.GetNameByFDName(Name);
                Name_Localised = JournalFieldNaming.CheckLocalisationTranslation(Name_Localised ?? "", FriendlyName);

                if (Category != null)
                {
                    Category           = JournalFieldNaming.NormaliseMaterialCategory(Category);
                    Category_Localised = JournalFieldNaming.CheckLocalisation(Category_Localised ?? "", Category);
                }
            }
Esempio n. 6
0
            public void Normalise()
            {
                Material           = JournalFieldNaming.FDNameTranslation(Material);
                FriendlyMaterial   = MaterialCommodityData.GetNameByFDName(Material);
                Material_Localised = JournalFieldNaming.CheckLocalisationTranslation(Material_Localised ?? "", FriendlyMaterial); // ensure.

                if (Category != null)                                                                                             // some entries do not have this
                {
                    Category           = JournalFieldNaming.NormaliseMaterialCategory(Category);                                  // fix up any strangeness
                    Category_Localised = JournalFieldNaming.CheckLocalisation(Category_Localised ?? "", Category);
                }
            }
Esempio n. 7
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);
                }
            }
            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);
                }
            }
        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 = JournalFieldNaming.CheckLocalisation(u.Name_Localised ?? "", u.Name);
                }
            }

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

            if (MaterialList != null)
            {
                foreach (Materials m in MaterialList)
                {
                    m.FriendlyName = MaterialCommodityData.GetNameByFDName(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
                                                 } }
            }
            ;
        }