Exemplo n.º 1
0
 private void OnDestroy()
 {
     if (Object.op_Inequality((Object)this.mUnitList, (Object)null))
     {
         Object.Destroy((Object)((Component)this.mUnitList).get_gameObject());
         this.mUnitList = (UnitListV2)null;
     }
     if (Object.op_Inequality((Object)this.mUEMain, (Object)null))
     {
         Object.Destroy((Object)((Component)this.mUEMain).get_gameObject());
         this.mUEMain = (UnitEnhanceV3)null;
     }
     if (Object.op_Inequality((Object)this.mEquipWindow, (Object)null))
     {
         Object.Destroy((Object)((Component)this.mEquipWindow).get_gameObject());
         this.mEquipWindow = (UnitEquipmentWindow)null;
     }
     if (!Object.op_Inequality((Object)this.mKakeraWindow, (Object)null))
     {
         return;
     }
     Object.Destroy((Object)((Component)this.mKakeraWindow).get_gameObject());
     this.mKakeraWindow = (UnitKakeraWindow)null;
 }
Exemplo n.º 2
0
        public static void FilterUnitsRevert(List <UnitData> units, List <int> sortValues, string[] filter)
        {
            if (filter == null)
            {
                return;
            }
            int           num1       = 0;
            int           num2       = 0;
            int           num3       = 0;
            List <string> stringList = new List <string>();
            string        s          = (string)null;

            for (int index = 0; index < filter.Length; ++index)
            {
                if (UnitListV2.GetValue(filter[index], "RARE:", ref s))
                {
                    int result;
                    if (int.TryParse(s, out result))
                    {
                        num1 |= 1 << result;
                    }
                }
                else if (UnitListV2.GetValue(filter[index], "ELEM:", ref s))
                {
                    try
                    {
                        EElement eelement = (EElement)Enum.Parse(typeof(EElement), s, true);
                        num2 |= 1 << (int)(eelement & (EElement)31 & (EElement)31);
                    }
                    catch
                    {
                        if (GameUtility.IsDebugBuild)
                        {
                            Debug.LogError((object)("Unknown element type: " + s));
                        }
                    }
                }
                else if (UnitListV2.GetValue(filter[index], "WEAPON:", ref s))
                {
                    try
                    {
                        AttackDetailTypes attackDetailTypes = (AttackDetailTypes)Enum.Parse(typeof(AttackDetailTypes), s, true);
                        num3 |= 1 << (int)(attackDetailTypes & (AttackDetailTypes)31 & (AttackDetailTypes)31);
                    }
                    catch
                    {
                        if (GameUtility.IsDebugBuild)
                        {
                            Debug.LogError((object)("Unknown weapon type: " + s));
                        }
                    }
                }
                else if (UnitListV2.GetValue(filter[index], "BIRTH:", ref s))
                {
                    stringList.Add(s);
                }
            }
            for (int index = units.Count - 1; index >= 0; --index)
            {
                UnitData unit = units[index];
                if ((1 << unit.Rarity & num1) != 0 || (1 << (int)(unit.Element & (EElement)31) & num2) != 0 || (unit.CurrentJob.GetAttackSkill() == null || (1 << (int)(unit.CurrentJob.GetAttackSkill().AttackDetailType & (AttackDetailTypes)31) & num3) != 0) || (string.IsNullOrEmpty((string)unit.UnitParam.birth) || stringList.Contains(unit.UnitParam.birth.ToString())))
                {
                    units.RemoveAt(index);
                    if (sortValues != null)
                    {
                        sortValues.RemoveAt(index);
                    }
                }
            }
        }
Exemplo n.º 3
0
        protected virtual void RefreshUnit(bool clear)
        {
            List <UnitData> units1       = MonoSingleton <GameManager> .Instance.Player.Units;
            List <UnitData> unitDataList = new List <UnitData>();

            for (int index = 0; index < units1.Count; ++index)
            {
                UnitData unitData = units1[index];
                if (this.IncludeShujinko || (int)unitData.UnitParam.hero == 0)
                {
                    unitDataList.Add(unitData);
                }
            }
            List <UnitData> units2 = new List <UnitData>((IEnumerable <UnitData>)unitDataList);

            if (this.mUnitSortMode != GameUtility.UnitSortModes.Time)
            {
                GameUtility.SortUnits(units2, this.mUnitSortMode, false, out this.mSortValues, true);
            }
            else
            {
                this.mSortValues = (int[])null;
            }
            int        count      = units2.Count;
            List <int> sortValues = (List <int>)null;

            if (this.mSortValues != null && this.mSortValues.Length > 0)
            {
                sortValues = new List <int>((IEnumerable <int>) this.mSortValues);
            }
            UnitListV2.FilterUnits(units2, sortValues, this.mUnitFilter);
            if (sortValues != null)
            {
                this.mSortValues = sortValues.ToArray();
            }
            if (Object.op_Inequality((Object)this.NoMatchingUnit, (Object)null))
            {
                this.NoMatchingUnit.SetActive(count > 0 && units2.Count <= 0);
            }
            if (this.mReverse)
            {
                units2.Reverse();
                if (this.mSortValues != null)
                {
                    Array.Reverse((Array)this.mSortValues);
                }
            }
            string s = FlowNode_Variable.Get("LAST_SELECTED_UNITID");

            if (!string.IsNullOrEmpty(s))
            {
                // ISSUE: object of a compiler-generated type is created
                // ISSUE: variable of a compiler-generated type
                UnitListV2.\u003CRefreshUnit\u003Ec__AnonStorey1AE unitCAnonStorey1Ae = new UnitListV2.\u003CRefreshUnit\u003Ec__AnonStorey1AE();
                // ISSUE: reference to a compiler-generated field
                unitCAnonStorey1Ae.lastselected_uniqueId = long.Parse(s);
                // ISSUE: reference to a compiler-generated field
                // ISSUE: reference to a compiler-generated field
                if (unitCAnonStorey1Ae.lastselected_uniqueId > 0L && this.mSelectUnitUniqueID > 0L && unitCAnonStorey1Ae.lastselected_uniqueId != this.mSelectUnitUniqueID)
                {
                    // ISSUE: reference to a compiler-generated method
                    int index = units2.FindIndex(new Predicate <UnitData>(unitCAnonStorey1Ae.\u003C\u003Em__14C));
                    if (index >= 0)
                    {
                        this.SetPageIndex(index / this.CellCount, false);
                    }
                }
                FlowNode_Variable.Set("LAST_SELECTED_UNITID", string.Empty);
                this.mSelectUnitUniqueID = -1L;
            }
            this.SetData((object[])units2.ToArray(), typeof(UnitData));
        }