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); }
protected virtual void Refresh() { if (Object.op_Equality((Object)this.ItemTemplate, (Object)null)) { return; } for (int index = this.mItems.Count - 1; index >= 0; --index) { Object.Destroy((Object)this.mItems[index]); } QuestParam dataOfClass = DataSource.FindDataOfClass <QuestParam>(((Component)this).get_gameObject(), (QuestParam)null); if (dataOfClass == null || !Object.op_Inequality((Object)QuestDropParam.Instance, (Object)null)) { return; } List <BattleCore.DropItemParam> dropItemParamList = QuestDropParam.Instance.GetQuestDropItemParamList(dataOfClass.iname, GlobalVars.GetDropTableGeneratedDateTime()); if (dropItemParamList == null) { return; } for (int index = 0; index < dropItemParamList.Count; ++index) { BattleCore.DropItemParam dropItemParam = dropItemParamList[index]; if (dropItemParam != null) { GameObject root = (GameObject)Object.Instantiate <GameObject>((M0)this.ItemTemplate); if (dropItemParam.IsItem) { DataSource.Bind <ItemParam>(root, dropItemParam.itemParam); } else if (dropItemParam.IsConceptCard) { DataSource.Bind <ConceptCardParam>(root, dropItemParam.conceptCardParam); } root.get_transform().SetParent(((Component)this).get_transform(), false); root.SetActive(true); GameParameter.UpdateAll(root); } } }
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); }