예제 #1
0
        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);
        }
예제 #2
0
        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();
        }
예제 #3
0
        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);
        }
예제 #4
0
        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);
            }
        }
예제 #5
0
        public GDENPCData DeepClone()
        {
            GDENPCData newClone = ShallowClone();

            return(newClone);
        }