public SimpleDropTableList FindSimpleDropTables(string iname) { if (string.IsNullOrEmpty(iname)) { return((SimpleDropTableList)null); } this.CompleteLoading(); SimpleDropTableList simpleDropTableList1; if (this.mSimpleDropTableDict.TryGetValue(iname, out simpleDropTableList1)) { return(simpleDropTableList1); } SimpleDropTableList simpleDropTableList2 = new SimpleDropTableList(); for (int index = this.mSimpleDropTables.Count - 1; index >= 0; --index) { if (this.mSimpleDropTables[index].GetCommonName == iname) { simpleDropTableList2.smp_drp_tbls.Add(this.mSimpleDropTables[index]); } } this.mSimpleDropTableDict.Add(iname, simpleDropTableList2); return(simpleDropTableList2); }
public EnemyDropList FindSimpleLocalMaps(string iname) { if (string.IsNullOrEmpty(iname)) { return((EnemyDropList)null); } this.CompleteLoading(); EnemyDropList enemyDropList1; if (this.mSimpleLocalMapsDict.TryGetValue(iname, out enemyDropList1)) { return(enemyDropList1); } EnemyDropList enemyDropList2 = new EnemyDropList(); for (int index1 = this.mSimpleLocalMaps.Count - 1; index1 >= 0; --index1) { if (!(this.mSimpleLocalMaps[index1].iname != iname) && this.mSimpleLocalMaps[index1].droplist != null) { for (int index2 = 0; index2 < this.mSimpleLocalMaps[index1].droplist.Length; ++index2) { if (!string.IsNullOrEmpty(this.mSimpleLocalMaps[index1].droplist[index2])) { SimpleDropTableList simpleDropTables = this.FindSimpleDropTables(this.mSimpleLocalMaps[index1].droplist[index2]); enemyDropList2.drp_tbls.Add(simpleDropTables); } } } } this.mSimpleLocalMapsDict.Add(iname, enemyDropList2); return(enemyDropList2); }
public List <BattleCore.DropItemParam> GetQuestDropItemParamList(string quest_iname, DateTime date_time) { List <BattleCore.DropItemParam> dropItemParamList = new List <BattleCore.DropItemParam>(); SimpleDropTableList simpleDropTables = this.FindSimpleDropTables(quest_iname); if (simpleDropTables != null) { List <BattleCore.DropItemParam> timeDropItemParams = this.GetCurrTimeDropItemParams(new List <SimpleDropTableList>() { simpleDropTables }, date_time); if (timeDropItemParams != null) { dropItemParamList.AddRange((IEnumerable <BattleCore.DropItemParam>)timeDropItemParams); } } List <BattleCore.DropItemParam> enemyDropItemParams = this.GetEnemyDropItemParams(quest_iname, date_time); if (enemyDropItemParams != null) { using (List <BattleCore.DropItemParam> .Enumerator enumerator = enemyDropItemParams.GetEnumerator()) { while (enumerator.MoveNext()) { BattleCore.DropItemParam param = enumerator.Current; if (!dropItemParamList.Exists((Predicate <BattleCore.DropItemParam>)(drop => drop.Iname == param.Iname))) { dropItemParamList.Add(param); } } } } return(dropItemParamList); }
public List <ItemParam> GetQuestDropList(string quest_iname, DateTime date_time) { List <ItemParam> itemParamList = new List <ItemParam>(); SimpleDropTableList simpleDropTables = this.FindSimpleDropTables(quest_iname); if (simpleDropTables != null) { List <ItemParam> currTimeDropItems = this.GetCurrTimeDropItems(new List <SimpleDropTableList>() { simpleDropTables }, date_time); if (currTimeDropItems != null) { itemParamList.AddRange((IEnumerable <ItemParam>)currTimeDropItems); } } List <ItemParam> enemyDropItems = this.GetEnemyDropItems(quest_iname, date_time); if (enemyDropItems != null) { using (List <ItemParam> .Enumerator enumerator = enemyDropItems.GetEnumerator()) { while (enumerator.MoveNext()) { ItemParam current = enumerator.Current; if (!itemParamList.Contains(current)) { itemParamList.Add(current); } } } } return(itemParamList); }
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); }
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); }