private void HandleShipmentItemPushed(int charShipmentID, MobileClientShipmentItem item) { TroopsListItem[] componentsInChildren = this.m_troopsListContents.GetComponentsInChildren <TroopsListItem>(true); TroopsListItem[] array = componentsInChildren; for (int i = 0; i < array.Length; i++) { TroopsListItem troopsListItem = array[i]; if (troopsListItem.GetCharShipmentTypeID() == charShipmentID) { troopsListItem.HandleShipmentItemPushed(item); } } }
private void InitList() { MobileClientShipmentType[] availableShipmentTypes = PersistentShipmentData.GetAvailableShipmentTypes(); if (availableShipmentTypes == null || availableShipmentTypes.Length == 0) { this.m_noRecruitsYetMessage.get_gameObject().SetActive(true); } else { this.m_noRecruitsYetMessage.get_gameObject().SetActive(false); } TroopsListItem[] componentsInChildren = this.m_troopsListContents.GetComponentsInChildren <TroopsListItem>(); TroopsListItem[] array = componentsInChildren; for (int i = 0; i < array.Length; i++) { TroopsListItem troopsListItem = array[i]; bool flag = true; if (availableShipmentTypes != null) { MobileClientShipmentType[] array2 = availableShipmentTypes; for (int j = 0; j < array2.Length; j++) { MobileClientShipmentType mobileClientShipmentType = array2[j]; if (troopsListItem.GetCharShipmentTypeID() == mobileClientShipmentType.CharShipmentID) { flag = false; break; } } } if (flag) { Object.DestroyImmediate(troopsListItem.get_gameObject()); } } if (availableShipmentTypes == null) { return; } componentsInChildren = this.m_troopsListContents.GetComponentsInChildren <TroopsListItem>(); for (int k = 0; k < availableShipmentTypes.Length; k++) { bool flag2 = false; TroopsListItem[] array3 = componentsInChildren; for (int l = 0; l < array3.Length; l++) { TroopsListItem troopsListItem2 = array3[l]; if (troopsListItem2.GetCharShipmentTypeID() == availableShipmentTypes[k].CharShipmentID) { flag2 = true; break; } } if (!flag2) { GameObject gameObject = Object.Instantiate <GameObject>(this.m_troopsListItemPrefab); gameObject.get_transform().SetParent(this.m_troopsListContents.get_transform(), false); TroopsListItem component = gameObject.GetComponent <TroopsListItem>(); component.SetCharShipment(availableShipmentTypes[k]); FancyEntrance component2 = component.GetComponent <FancyEntrance>(); component2.m_timeToDelayEntrance = this.m_listItemInitialEntranceDelay + this.m_listItemEntranceDelay * (float)k; component2.Activate(); } } }
private void InitList() { MobileClientShipmentType[] availableShipmentTypes = PersistentShipmentData.GetAvailableShipmentTypes(); if (availableShipmentTypes == null || availableShipmentTypes.Length == 0) { this.m_noRecruitsYetMessage.get_gameObject().SetActive(true); } else { this.m_noRecruitsYetMessage.get_gameObject().SetActive(false); } TroopsListItem[] componentsInChildren = this.m_troopsListContents.GetComponentsInChildren <TroopsListItem>(true); TroopsListItem[] array = componentsInChildren; for (int i = 0; i < array.Length; i++) { TroopsListItem troopsListItem = array[i]; bool flag = true; if (availableShipmentTypes != null) { MobileClientShipmentType[] array2 = availableShipmentTypes; for (int j = 0; j < array2.Length; j++) { MobileClientShipmentType mobileClientShipmentType = array2[j]; if (troopsListItem.GetCharShipmentTypeID() == mobileClientShipmentType.CharShipmentID) { flag = false; break; } } } if (flag) { Object.DestroyImmediate(troopsListItem.get_gameObject()); } } if (availableShipmentTypes == null) { return; } componentsInChildren = this.m_troopsListContents.GetComponentsInChildren <TroopsListItem>(true); for (int k = 0; k < availableShipmentTypes.Length; k++) { bool flag2 = false; TroopsListItem[] array3 = componentsInChildren; for (int l = 0; l < array3.Length; l++) { TroopsListItem troopsListItem2 = array3[l]; if (troopsListItem2.GetCharShipmentTypeID() == availableShipmentTypes[k].CharShipmentID) { flag2 = true; break; } } if (!flag2) { GameObject gameObject = Object.Instantiate <GameObject>(this.m_troopsListItemPrefab); gameObject.get_transform().SetParent(this.m_troopsListContents.get_transform(), false); TroopsListItem component = gameObject.GetComponent <TroopsListItem>(); component.SetCharShipment(availableShipmentTypes[k], false, null); FancyEntrance component2 = component.GetComponent <FancyEntrance>(); component2.m_timeToDelayEntrance = this.m_listItemInitialEntranceDelay + this.m_listItemEntranceDelay * (float)k; component2.Activate(); } } IEnumerator enumerator = PersistentShipmentData.shipmentDictionary.get_Values().GetEnumerator(); try { while (enumerator.MoveNext()) { JamCharacterShipment jamCharacterShipment = (JamCharacterShipment)enumerator.get_Current(); if (!PersistentShipmentData.ShipmentTypeForShipmentIsAvailable(jamCharacterShipment.ShipmentRecID)) { CharShipmentRec record = StaticDB.charShipmentDB.GetRecord(jamCharacterShipment.ShipmentRecID); if (record != null) { GameObject gameObject2 = Object.Instantiate <GameObject>(this.m_troopsListItemPrefab); gameObject2.get_transform().SetParent(this.m_troopsListContents.get_transform(), false); TroopsListItem component3 = gameObject2.GetComponent <TroopsListItem>(); component3.SetCharShipment(null, true, record); } } } } finally { IDisposable disposable = enumerator as IDisposable; if (disposable != null) { disposable.Dispose(); } } }