public static void ImportObjectFromJson([NotNull] Simulator sim, [NotNull][ItemNotNull] List <JsonModularHousehold> jsonHouseholds)
        {
            foreach (JsonModularHousehold jsonHH in jsonHouseholds)
            {
                ModularHousehold mhh = sim.ModularHouseholds.FindByGuid(jsonHH.Guid);
                if (mhh == null)
                {
                    Logger.Info(jsonHH.Name + " not found, creating...");
                    mhh = sim.ModularHouseholds.CreateNewItem(sim.ConnectionString);
                }

                mhh.ImportFromJsonTemplate(jsonHH, sim);
            }
        }
Ejemplo n.º 2
0
 public TemplatePerson([NotNull] string pName, [CanBeNull] int?id, [NotNull]  string description, [NotNull] string connectionString, int age,
                       int averageSicknessDuration, PermittedGender gender, int sickDays,
                       [CanBeNull] ModularHousehold baseHousehold, [CanBeNull] Person basePerson, StrGuid guid) : base(pName, TableName,
                                                                                                                       connectionString, guid)
 {
     ID = id;
     TypeDescription          = "Household Template";
     _description             = description;
     _age                     = age;
     _averageSicknessDuration = averageSicknessDuration;
     _gender                  = gender;
     _sickDays                = sickDays;
     _baseHousehold           = baseHousehold;
     _basePerson              = basePerson;
 }