private static XElement GetMaidData(Maid maid)
        {
            BackUpMaidData orNullMaidData = BackUpData.GetOrNullMaidData(maid);
            bool           flag           = orNullMaidData == null;
            XElement       result;

            if (flag)
            {
                result = null;
            }
            else
            {
                XElement xelement  = new XElement("Maid");
                XElement xelement2 = new XElement("GUID");
                xelement2.Add(maid.status.guid);
                XElement xelement3 = new XElement("Name");
                xelement3.Add(maid.status.fullNameJpStyle);
                xelement.Add(xelement2);
                xelement.Add(xelement3);
                XElement xelement4 = new XElement("Slots");
                foreach (int slotID in orNullMaidData.slotDataDic.Keys)
                {
                    XElement slotData = SceneDataManager.GetSlotData(maid, slotID);
                    bool     flag2    = slotData == null;
                    if (!flag2)
                    {
                        xelement4.Add(slotData);
                    }
                }
                xelement.Add(xelement4);
                result = xelement;
            }
            return(result);
        }
Ejemplo n.º 2
0
        public static BackUpMaidData GetOrNullMaidData(Maid maid)
        {
            BackUpMaidData result = null;
            bool           flag   = BackUpData.maidDataDic.ContainsKey(maid);

            if (flag)
            {
                result = BackUpData.maidDataDic[maid];
            }
            return(result);
        }
Ejemplo n.º 3
0
        public static BackUpSlotData GetOrNullMaidSlotData(Maid maid, int slotNo)
        {
            BackUpSlotData result         = null;
            BackUpMaidData orNullMaidData = BackUpData.GetOrNullMaidData(maid);
            bool           flag           = orNullMaidData != null && orNullMaidData.slotDataDic.ContainsKey(slotNo);

            if (flag)
            {
                result = orNullMaidData.slotDataDic[slotNo];
            }
            return(result);
        }
Ejemplo n.º 4
0
        public static void RestoreMaid(Maid maid)
        {
            BackUpMaidData orNullMaidData = BackUpData.GetOrNullMaidData(maid);
            bool           flag           = orNullMaidData == null;

            if (!flag)
            {
                List <int> list = new List <int>(orNullMaidData.slotDataDic.Keys);
                foreach (int slotNo in list)
                {
                    BackUpData.RestoreSlot(maid, slotNo);
                }
                BackUpData.maidDataDic.Remove(maid);
            }
        }
Ejemplo n.º 5
0
        public static BackUpMaidData GetOrAddMaidData(Maid maid)
        {
            bool           flag = BackUpData.maidDataDic.ContainsKey(maid);
            BackUpMaidData backUpMaidData;

            if (flag)
            {
                backUpMaidData = BackUpData.maidDataDic[maid];
            }
            else
            {
                backUpMaidData = new BackUpMaidData();
                BackUpData.maidDataDic.Add(maid, backUpMaidData);
            }
            return(backUpMaidData);
        }
Ejemplo n.º 6
0
        public static void RefreshMaid(Maid maid)
        {
            BackUpMaidData orNullMaidData = BackUpData.GetOrNullMaidData(maid);
            bool           flag           = orNullMaidData == null;

            if (!flag)
            {
                foreach (int slotNo in orNullMaidData.slotDataDic.Keys)
                {
                    BackUpData.RefreshSlot(maid, slotNo);
                }
                orNullMaidData.slotDataDic = (from kvp in orNullMaidData.slotDataDic
                                              where kvp.Value.objectDataDic.Count != 0
                                              select kvp).ToDictionary((KeyValuePair <int, BackUpSlotData> kvp) => kvp.Key, (KeyValuePair <int, BackUpSlotData> kvp) => kvp.Value);
            }
        }
Ejemplo n.º 7
0
        public static BackUpSlotData GetOrAddMaidSlotData(Maid maid, int slotNo)
        {
            BackUpMaidData orAddMaidData = BackUpData.GetOrAddMaidData(maid);
            bool           flag          = orAddMaidData.slotDataDic.ContainsKey(slotNo);
            BackUpSlotData backUpSlotData;

            if (flag)
            {
                backUpSlotData = orAddMaidData.slotDataDic[slotNo];
            }
            else
            {
                backUpSlotData = new BackUpSlotData();
                orAddMaidData.slotDataDic.Add(slotNo, backUpSlotData);
            }
            return(backUpSlotData);
        }
Ejemplo n.º 8
0
        public static void RestoreSlot(Maid maid, int slotNo)
        {
            BackUpSlotData orNullMaidSlotData = BackUpData.GetOrNullMaidSlotData(maid, slotNo);
            bool           flag = orNullMaidSlotData == null;

            if (!flag)
            {
                List <GameObject> list = new List <GameObject>(orNullMaidSlotData.objectDataDic.Keys);
                foreach (GameObject gameObject in list)
                {
                    bool flag2 = !gameObject;
                    if (!flag2)
                    {
                        BackUpData.RestoreObject(maid, slotNo, gameObject);
                    }
                }
                BackUpMaidData orNullMaidData = BackUpData.GetOrNullMaidData(maid);
                orNullMaidData.slotDataDic.Remove(slotNo);
            }
        }