Esempio n. 1
0
        private List <ItemParam> GetCurrTimeDropItems(List <SimpleDropTableList> drop_tbls, DateTime date_time)
        {
            List <string> stringList = new List <string>();
            DateTime      t1         = DateTime.MinValue;

            using (List <SimpleDropTableList> .Enumerator enumerator1 = drop_tbls.GetEnumerator())
            {
                while (enumerator1.MoveNext())
                {
                    SimpleDropTableList current1 = enumerator1.Current;
                    if (current1.smp_drp_tbls.Count != 0)
                    {
                        string[] strArray1 = (string[])null;
                        string[] strArray2 = (string[])null;
                        using (List <SimpleDropTableParam> .Enumerator enumerator2 = current1.smp_drp_tbls.GetEnumerator())
                        {
                            while (enumerator2.MoveNext())
                            {
                                SimpleDropTableParam current2 = enumerator2.Current;
                                if (!current2.IsSuffix)
                                {
                                    strArray1 = current2.dropList;
                                }
                                else if (current2.IsAvailablePeriod(date_time) && (strArray2 == null || 0 < DateTime.Compare(t1, current2.beginAt)))
                                {
                                    strArray2 = current2.dropList;
                                    t1        = current2.beginAt;
                                }
                            }
                        }
                        string[] strArray3 = strArray2 ?? strArray1;
                        if (strArray3 != null)
                        {
                            stringList.AddRange((IEnumerable <string>)strArray3);
                        }
                    }
                }
            }
            if (stringList.Count == 0)
            {
                return((List <ItemParam>)null);
            }
            List <ItemParam> itemParamList = new List <ItemParam>();

            for (int index = 0; index < stringList.Count; ++index)
            {
                ItemParam itemParam = MonoSingleton <GameManager> .Instance.GetItemParam(stringList[index]);

                itemParamList.Add(itemParam);
            }
            return(itemParamList);
        }
Esempio n. 2
0
 public void Deserialize(JSON_QuestDropParam json)
 {
     this.mSimpleDropTables.Clear();
     this.mSimpleLocalMaps.Clear();
     this.mSimpleQuestDrops.Clear();
     if (json.simpleDropTable != null)
     {
         for (int index = 0; index < json.simpleDropTable.Length; ++index)
         {
             SimpleDropTableParam simpleDropTableParam = new SimpleDropTableParam();
             if (simpleDropTableParam.Deserialize(json.simpleDropTable[index]))
             {
                 this.mSimpleDropTables.Add(simpleDropTableParam);
             }
         }
     }
     if (json.simpleLocalMaps != null)
     {
         for (int index = 0; index < json.simpleLocalMaps.Length; ++index)
         {
             SimpleLocalMapsParam simpleLocalMapsParam = new SimpleLocalMapsParam();
             if (simpleLocalMapsParam.Deserialize(json.simpleLocalMaps[index]))
             {
                 this.mSimpleLocalMaps.Add(simpleLocalMapsParam);
             }
         }
     }
     if (json.simpleQuestDrops != null)
     {
         for (int index = 0; index < json.simpleQuestDrops.Length; ++index)
         {
             SimpleQuestDropParam simpleQuestDropParam = new SimpleQuestDropParam();
             if (simpleQuestDropParam.Deserialize(json.simpleQuestDrops[index]))
             {
                 this.mSimpleQuestDrops.Add(simpleQuestDropParam);
             }
         }
     }
     this.mIsLoaded = true;
 }
Esempio n. 3
0
        private List <BattleCore.DropItemParam> GetCurrTimeDropItemParams(List <SimpleDropTableList> drop_tbls, DateTime date_time)
        {
            List <string> stringList1 = new List <string>();
            List <string> stringList2 = new List <string>();
            DateTime      t1          = DateTime.MinValue;

            using (List <SimpleDropTableList> .Enumerator enumerator1 = drop_tbls.GetEnumerator())
            {
                while (enumerator1.MoveNext())
                {
                    SimpleDropTableList current1 = enumerator1.Current;
                    if (current1.smp_drp_tbls.Count != 0)
                    {
                        string[] strArray1 = (string[])null;
                        string[] strArray2 = (string[])null;
                        string[] strArray3 = (string[])null;
                        string[] strArray4 = (string[])null;
                        using (List <SimpleDropTableParam> .Enumerator enumerator2 = current1.smp_drp_tbls.GetEnumerator())
                        {
                            while (enumerator2.MoveNext())
                            {
                                SimpleDropTableParam current2 = enumerator2.Current;
                                if (!current2.IsSuffix)
                                {
                                    strArray1 = current2.dropList;
                                    strArray2 = current2.dropcards;
                                }
                                else if (current2.IsAvailablePeriod(date_time) && (strArray3 == null || 0 < DateTime.Compare(t1, current2.beginAt)) && (strArray4 == null || 0 < DateTime.Compare(t1, current2.beginAt)))
                                {
                                    strArray3 = current2.dropList;
                                    strArray4 = current2.dropcards;
                                    t1        = current2.beginAt;
                                }
                            }
                        }
                        string[] strArray5 = strArray3 ?? strArray1;
                        if (strArray5 != null)
                        {
                            stringList1.AddRange((IEnumerable <string>)strArray5);
                        }
                        string[] strArray6 = strArray4 ?? strArray2;
                        if (strArray6 != null)
                        {
                            stringList2.AddRange((IEnumerable <string>)strArray6);
                        }
                    }
                }
            }
            if (stringList1.Count == 0 && stringList2.Count == 0)
            {
                return((List <BattleCore.DropItemParam>)null);
            }
            List <BattleCore.DropItemParam> dropItemParamList = new List <BattleCore.DropItemParam>();

            for (int index = 0; index < stringList1.Count; ++index)
            {
                BattleCore.DropItemParam dropItemParam = new BattleCore.DropItemParam(MonoSingleton <GameManager> .Instance.GetItemParam(stringList1[index]));
                dropItemParamList.Add(dropItemParam);
            }
            for (int index = 0; index < stringList2.Count; ++index)
            {
                BattleCore.DropItemParam dropItemParam = new BattleCore.DropItemParam(MonoSingleton <GameManager> .Instance.MasterParam.GetConceptCardParam(stringList2[index]));
                dropItemParamList.Add(dropItemParam);
            }
            return(dropItemParamList);
        }