5 protected ref array<ref SCR_EditorAttributeStruct> at = {};
7 static void SerializeFactions(out notnull array<ref SCR_EditableFactionStruct> outEntries,
SCR_EditorAttributeList attributeList)
16 SCR_SortedArray<SCR_EditableFactionComponent> delegates =
new SCR_SortedArray<SCR_EditableFactionComponent>();
17 for (
int i, count = delegateManager.GetSortedFactionDelegates(delegates); i < count; i++)
19 SerializeFaction(delegates[i], outEntries, attributeList);
22 protected static void SerializeFaction(SCR_EditableFactionComponent faction, out notnull array<ref SCR_EditableFactionStruct> outEntries,
SCR_EditorAttributeList attributeList)
25 entry.fk = faction.GetFaction().GetFactionKey();
26 outEntries.Insert(entry);
30 static void DeserializeFactions(notnull array<ref SCR_EditableFactionStruct> entries,
SCR_EditorAttributeList attributeList =
null)
32 FactionManager factionManager =
GetGame().GetFactionManager();
41 SCR_EditableFactionComponent factionDelegate;
44 faction = factionManager.GetFactionByKey(entry.fk);
45 factionDelegate = delegateManager.GetFactionDelegate(faction);
52 Print(
string.Format(
"SCR_EditableFactionStruct: Cannot load faction '%1', it's not configured in FactionManager!", entry.fk), LogLevel.WARNING);
56 SCR_SortedArray<SCR_EditableFactionComponent> delegates =
new SCR_SortedArray<SCR_EditableFactionComponent>();
57 for (
int i, count = delegateManager.GetSortedFactionDelegates(delegates); i < count; i++)
61 static void LogFactions(notnull array<ref SCR_EditableFactionStruct> entries,
SCR_EditorAttributeList attributeList =
null)
63 Print(
" SCR_EditableFactionStruct: " + entries.Count());
66 PrintFormat(
" %1", entry.fk);