Exemple #1
0
    /// <summary>
    /// 申请列表排序
    /// </summary>
    /// <param name="type"></param>
    void ApplyMemberSortByType(MemberSortType type)
    {
        if (m_list_applyUserIds.Count == 0)
        {
            return;
        }
        ApplyReverse = curApplySortType == type;
        if (ApplyReverse)
        {
            m_list_applyUserIds.Reverse();
        }
        else
        {
            bool isNeedExchange = false;
            uint temp           = 0;
            stRequestListClanUserCmd_S.Data applyData_i = null;
            stRequestListClanUserCmd_S.Data applyData_j = null;
            int length = m_list_applyUserIds.Count - 1;
            for (int i = 0; i < length; i++)
            {
                applyData_i = m_mgr.GetClanApplyUserInfo(m_list_applyUserIds[i]);
                if (applyData_i == null)
                {
                    break;
                }
                for (int j = length; j > i; j--)
                {
                    applyData_j = m_mgr.GetClanApplyUserInfo(m_list_applyUserIds[j]);
                    if (applyData_j == null)
                    {
                        break;
                    }
                    switch (type)
                    {
                    case MemberSortType.None:
                        break;

                    case MemberSortType.Profession:
                        isNeedExchange = applyData_i.jov < applyData_j.jov;
                        break;

                    case MemberSortType.Name:
                        isNeedExchange = applyData_i.name.CompareTo(applyData_j.name) < 0;
                        break;

                    case MemberSortType.Lv:
                        isNeedExchange = applyData_i.level < applyData_j.level;
                        break;

                    case MemberSortType.Fight:
                        isNeedExchange = applyData_i.fight < applyData_j.fight;
                        break;
                    }
                    if (isNeedExchange)
                    {
                        temp = m_list_applyUserIds[j];
                        m_list_applyUserIds[j] = m_list_applyUserIds[i];
                        m_list_applyUserIds[i] = temp;
                    }
                }
            }
            curApplySortType = type;
        }
        m_applyCreator.CreateGrids(m_list_applyUserIds.Count);
    }
Exemple #2
0
 void MemberSortByType(MemberSortType type)
 {
     m_list_memberdatas = DataManager.Manager <ClanManger>().MemberSortByType(type);
     m_memberCreator.CreateGrids(m_list_memberdatas.Count);
 }