public static void ResetPersistent() { FileInfo fileInfo = new FileInfo(GenFilePaths.ConceptKnowledgeFilePath); if (fileInfo.Exists) { fileInfo.Delete(); } PlayerKnowledgeDatabase.data = new PlayerKnowledgeDatabase.ConceptKnowledge(); }
public static void ReloadAndRebind() { PlayerKnowledgeDatabase.data = DirectXmlLoader.ItemFromXmlFile <PlayerKnowledgeDatabase.ConceptKnowledge>(GenFilePaths.ConceptKnowledgeFilePath, true); foreach (ConceptDef current in DefDatabase <ConceptDef> .AllDefs) { if (!PlayerKnowledgeDatabase.data.knowledge.ContainsKey(current)) { Log.Warning("Knowledge data was missing key " + current + ". Adding it...", false); PlayerKnowledgeDatabase.data.knowledge.Add(current, 0f); } } }