public bool Same(EngineeringData other)
            {
                if (other == null || Engineer != other.Engineer || BlueprintName != other.BlueprintName || EngineerID != other.EngineerID || BlueprintID != other.BlueprintID ||
                    Level != other.Level || Quality != other.Quality || ExperimentalEffect != other.ExperimentalEffect || ExperimentalEffect_Localised != other.ExperimentalEffect_Localised)
                {
                    return(false);
                }
                else if (Modifiers != null || other.Modifiers != null)
                {
                    if (Modifiers == null || other.Modifiers == null || Modifiers.Length != other.Modifiers.Length)
                    {
                        return(false);
                    }
                    else
                    {
                        for (int i = 0; i < Modifiers.LongLength; i++)
                        {
                            if (Modifiers[i].Label != other.Modifiers[i].Label || Modifiers[i].ValueStr != other.Modifiers[i].ValueStr ||
                                Modifiers[i].Value != other.Modifiers[i].Value || Modifiers[i].OriginalValue != other.Modifiers[i].OriginalValue || Modifiers[i].LessIsGood != other.Modifiers[i].LessIsGood)
                            {
                                return(false);
                            }
                        }
                    }
                }

                return(true);
            }
 public ShipModule(string s, string sfd, string i, string ifd,
                   bool?e, int?prior, int?ac, int?ah, double?health, long?value,
                   double?power,
                   EngineeringData engineering)
 {
     Slot = s; SlotFD = sfd; Item = i; ItemFD = ifd; Enabled = e; Priority = prior; AmmoClip = ac; AmmoHopper = ah;
     if (health.HasValue)
     {
         Health = (int)(health * 100.0);
     }
     Value       = value;
     Power       = power;
     Engineering = engineering;
 }
        public JournalEngineerCraftBase(JObject evt, JournalTypeEnum en) : base(evt, en)
        {
            Slot   = JournalFieldNaming.GetBetterSlotName(evt["Slot"].Str());
            SlotFD = JournalFieldNaming.NormaliseFDSlotName(evt["Slot"].Str());

            Module   = JournalFieldNaming.GetBetterItemNameEvents(evt["Module"].Str());
            ModuleFD = JournalFieldNaming.NormaliseFDItemName(evt["Module"].Str());

            Engineering = new EngineeringData(evt);

            IsPreview = evt["IsPreview"].BoolNull();
            JToken mats = (JToken)evt["Ingredients"];

            if (mats != null)
            {
                Ingredients = new Dictionary <string, int>();

                if (mats.Type == JTokenType.Object)
                {
                    Dictionary <string, int> temp = mats?.ToObject <Dictionary <string, int> >();

                    if (temp != null)
                    {
                        foreach (string key in temp.Keys)
                        {
                            Ingredients[JournalFieldNaming.FDNameTranslation(key)] = temp[key];
                        }
                    }
                }
                else
                {
                    foreach (JObject jo in (JArray)mats)
                    {
                        Ingredients[JournalFieldNaming.FDNameTranslation((string)jo["Name"])] = jo["Count"].Int();
                    }
                }
            }
        }
 public void SetEngineering(EngineeringData eng)
 {
     Engineering = eng;
 }