public override void LoadFromSavedData(string dataKey) { _key = dataKey; _level = GDEDataManager.GetInt(_key, levelKey, _level); _id = GDEDataManager.GetString(_key, idKey, _id); _NPC = GDEDataManager.GetCustom(_key, NPCKey, _NPC); }
public void Reset_NPC() { GDEDataManager.ResetToDefault(_key, NPCKey); Dictionary <string, object> dict; GDEDataManager.Get(_key, out dict); string customDataKey; dict.TryGetString(NPCKey, out customDataKey); _NPC = new GDENPCData(customDataKey); NPC.ResetAll(); }
public GDENPCData ShallowClone() { string newKey = Guid.NewGuid().ToString(); GDENPCData newClone = new GDENPCData(newKey); newClone.workingInBuliding = workingInBuliding; newClone.ShowInBag = ShowInBag; newClone.hashcode = hashcode; newClone.exp = exp; newClone.likability = likability; newClone.workPower0 = workPower0; newClone.workPower1 = workPower1; newClone.workPower2 = workPower2; newClone.id = id; return(newClone); }
public override void LoadFromDict(string dataKey, Dictionary <string, object> dict) { _key = dataKey; if (dict == null) { LoadFromSavedData(dataKey); } else { dict.TryGetInt(levelKey, out _level); dict.TryGetString(idKey, out _id); string customDataKey; dict.TryGetString(NPCKey, out customDataKey); _NPC = new GDENPCData(customDataKey); LoadFromSavedData(dataKey); } }
public GDENPCData DeepClone() { GDENPCData newClone = ShallowClone(); return(newClone); }