示例#1
0
        public static int GetSortStatus(UnitListWindow.Data data, UnitListSortWindow.SelectType type)
        {
            if (data.param == null)
            {
                return(0);
            }
            UnitParam   unitParam   = data.param;
            UnitData    unit        = data.unit;
            StatusParam statusParam = unitParam.ini_status.param;

            if (unit != null)
            {
                statusParam = unit.Status.param;
            }
            UnitListSortWindow.SelectType selectType = type;
            switch (selectType)
            {
            case UnitListSortWindow.SelectType.TIME:
                return(0);

            case UnitListSortWindow.SelectType.RARITY:
                if (unit != null)
                {
                    return(unit.Rarity);
                }
                return(1);

            case UnitListSortWindow.SelectType.LEVEL:
                if (unit != null)
                {
                    return(unit.Lv);
                }
                return(1);

            case UnitListSortWindow.SelectType.TOTAL:
                return((int)statusParam.atk + (int)statusParam.def + (int)statusParam.mag + (int)statusParam.mnd + (int)statusParam.spd + (int)statusParam.dex + (int)statusParam.cri + (int)statusParam.luk);

            default:
                if (selectType == UnitListSortWindow.SelectType.ATK)
                {
                    return((int)statusParam.atk);
                }
                if (selectType == UnitListSortWindow.SelectType.DEF)
                {
                    return((int)statusParam.def);
                }
                if (selectType == UnitListSortWindow.SelectType.MAG)
                {
                    return((int)statusParam.mag);
                }
                if (selectType == UnitListSortWindow.SelectType.MND)
                {
                    return((int)statusParam.mnd);
                }
                if (selectType == UnitListSortWindow.SelectType.HP)
                {
                    return((int)statusParam.hp);
                }
                if (selectType == UnitListSortWindow.SelectType.SPD)
                {
                    return((int)statusParam.spd);
                }
                if (selectType != UnitListSortWindow.SelectType.COMBINATION)
                {
                    if (selectType != UnitListSortWindow.SelectType.JOBRANK)
                    {
                        if (selectType == UnitListSortWindow.SelectType.AWAKE)
                        {
                            if (unit != null)
                            {
                                return(unit.AwakeLv);
                            }
                            return(1);
                        }
                        goto case UnitListSortWindow.SelectType.TIME;
                    }
                    else
                    {
                        if (unit != null)
                        {
                            return(unit.CurrentJob.Rank);
                        }
                        return(1);
                    }
                }
                else
                {
                    if (unit != null)
                    {
                        return(unit.GetCombination());
                    }
                    return(1);
                }
            }
        }
示例#2
0
 public static Sprite GetIcon(UnitListSortWindow.SelectType selectType)
 {
     return(GameSettings.Instance.GetUnitSortModeIcon(UnitListSortWindow.ConvertSelectType(selectType)));
 }
示例#3
0
 public bool IsType(UnitListSortWindow.SelectType value)
 {
     return((this.m_SelectType & value) != UnitListSortWindow.SelectType.NONE);
 }
示例#4
0
 private void ResetAlignment(UnitListSortWindow.SelectType selectType)
 {
     this.m_SelectType &= ~(selectType & (UnitListSortWindow.SelectType) 251658240);
 }
示例#5
0
 private void SetAlignment(UnitListSortWindow.SelectType selectType)
 {
     this.m_SelectType &= (UnitListSortWindow.SelectType) - 251658241;
     this.m_SelectType |= selectType & (UnitListSortWindow.SelectType) 251658240;
 }
示例#6
0
 private void ResetSection(UnitListSortWindow.SelectType selectType)
 {
     this.m_SelectType &= ~(selectType & (UnitListSortWindow.SelectType) 16777215);
 }
示例#7
0
 private void SetSection(UnitListSortWindow.SelectType selectType)
 {
     this.m_SelectType &= (UnitListSortWindow.SelectType) - 16777216;
     this.m_SelectType |= selectType & (UnitListSortWindow.SelectType) 16777215;
 }