public static void LoadAllBios()
 {
     foreach (PawnBio current in DirectXmlLoader.LoadXmlDataInResourcesFolder <PawnBio>("Backstories/Solid"))
     {
         current.name.ResolveMissingPieces(null);
         if (current.childhood == null || current.adulthood == null)
         {
             PawnNameDatabaseSolid.AddPlayerContentName(current.name, current.gender);
         }
         else
         {
             current.PostLoad();
             current.ResolveReferences();
             foreach (string current2 in current.ConfigErrors())
             {
                 Log.Error(current2, false);
             }
             SolidBioDatabase.allBios.Add(current);
             current.childhood.shuffleable = false;
             current.childhood.slot        = BackstorySlot.Childhood;
             current.adulthood.shuffleable = false;
             current.adulthood.slot        = BackstorySlot.Adulthood;
             BackstoryHardcodedData.InjectHardcodedData(current);
             BackstoryDatabase.AddBackstory(current.childhood);
             BackstoryDatabase.AddBackstory(current.adulthood);
         }
     }
 }
 public static void AddBackstory(Backstory bs)
 {
     BackstoryHardcodedData.InjectHardcodedData(bs);
     if (BackstoryDatabase.allBackstories.ContainsKey(bs.identifier))
     {
         if (bs == BackstoryDatabase.allBackstories[bs.identifier])
         {
             Log.Error("Tried to add the same backstory twice " + bs.identifier, false);
         }
         else
         {
             Log.Error(string.Concat(new string[]
             {
                 "Backstory ",
                 bs.title,
                 " has same unique save key ",
                 bs.identifier,
                 " as old backstory ",
                 BackstoryDatabase.allBackstories[bs.identifier].title
             }), false);
         }
         return;
     }
     BackstoryDatabase.allBackstories.Add(bs.identifier, bs);
     BackstoryDatabase.shuffleableBackstoryList.Clear();
 }
 public static void LoadAllBios()
 {
     foreach (PawnBio item in DirectXmlLoader.LoadXmlDataInResourcesFolder <PawnBio>("Backstories/Solid"))
     {
         item.name.ResolveMissingPieces(null);
         if (item.childhood == null || item.adulthood == null)
         {
             PawnNameDatabaseSolid.AddPlayerContentName(item.name, item.gender);
         }
         else
         {
             item.PostLoad();
             item.ResolveReferences();
             foreach (string item2 in item.ConfigErrors())
             {
                 Log.Error(item2);
             }
             SolidBioDatabase.allBios.Add(item);
             item.childhood.shuffleable = false;
             item.childhood.slot        = BackstorySlot.Childhood;
             item.adulthood.shuffleable = false;
             item.adulthood.slot        = BackstorySlot.Adulthood;
             BackstoryHardcodedData.InjectHardcodedData(item);
             BackstoryDatabase.AddBackstory(item.childhood);
             BackstoryDatabase.AddBackstory(item.adulthood);
         }
     }
 }
Exemple #4
0
 public static void LoadAllBios()
 {
     foreach (PawnBio pawnBio in DirectXmlLoader.LoadXmlDataInResourcesFolder <PawnBio>("Backstories/Solid"))
     {
         pawnBio.name.ResolveMissingPieces(null);
         if (pawnBio.childhood == null || pawnBio.adulthood == null)
         {
             PawnNameDatabaseSolid.AddPlayerContentName(pawnBio.name, pawnBio.gender);
         }
         else
         {
             pawnBio.PostLoad();
             pawnBio.ResolveReferences();
             foreach (string text in pawnBio.ConfigErrors())
             {
                 Log.Error(text, false);
             }
             SolidBioDatabase.allBios.Add(pawnBio);
             pawnBio.childhood.shuffleable = false;
             pawnBio.childhood.slot        = BackstorySlot.Childhood;
             pawnBio.adulthood.shuffleable = false;
             pawnBio.adulthood.slot        = BackstorySlot.Adulthood;
             BackstoryHardcodedData.InjectHardcodedData(pawnBio);
             BackstoryDatabase.AddBackstory(pawnBio.childhood);
             BackstoryDatabase.AddBackstory(pawnBio.adulthood);
         }
     }
 }
Exemple #5
0
 public static void AddBackstory(Backstory bs)
 {
     BackstoryHardcodedData.InjectHardcodedData(bs);
     if (BackstoryDatabase.allBackstories.ContainsKey(bs.identifier))
     {
         Log.Error("Backstory " + bs.Title + " has same unique save key " + bs.identifier + " as old backstory " + BackstoryDatabase.allBackstories[bs.identifier].Title);
     }
     else
     {
         BackstoryDatabase.allBackstories.Add(bs.identifier, bs);
     }
 }
Exemple #6
0
 public static void AddBackstory(Backstory bs)
 {
     BackstoryHardcodedData.InjectHardcodedData(bs);
     if (BackstoryDatabase.allBackstories.ContainsKey(bs.identifier))
     {
         Log.Error(string.Concat(new string[]
         {
             "Backstory ",
             bs.Title,
             " has same unique save key ",
             bs.identifier,
             " as old backstory ",
             BackstoryDatabase.allBackstories[bs.identifier].Title
         }));
         return;
     }
     BackstoryDatabase.allBackstories.Add(bs.identifier, bs);
 }
Exemple #7
0
 public static void AddBackstory(Backstory bs)
 {
     BackstoryHardcodedData.InjectHardcodedData(bs);
     if (allBackstories.ContainsKey(bs.identifier))
     {
         if (bs == allBackstories[bs.identifier])
         {
             Log.Error("Tried to add the same backstory twice " + bs.identifier);
         }
         else
         {
             Log.Error("Backstory " + bs.title + " has same unique save key " + bs.identifier + " as old backstory " + allBackstories[bs.identifier].title);
         }
     }
     else
     {
         allBackstories.Add(bs.identifier, bs);
         shuffleableBackstoryList.Clear();
     }
 }