예제 #1
0
    /// <summary>
    /// 관리의 멤버들 생성
    /// </summary>
    private void Creat_memberElement()
    {
        foreach (var member in Dic_ExistClanMember)
        {
            UIItem_MemberElement _element = UI_Manager.Getsingleton.CreatUI(UIITEM.ITEM_CLANMEMBERELEMENT, Lst_TrContent[(int)ClanUI_Type.Manage]) as UIItem_MemberElement;
            _element.Set_Element(member.Value, member.Value.CnRank == (byte)CLAN_MEMBER_TYPE.MASTER);

            Lst_MemberElement.Add(_element);
        }

        Sort_memberList(Lst_MemberElement);
    }
예제 #2
0
    /// <summary>
    /// 관리의 멤버들 정보 갱신 (시간 정보, 및 이름변경 , 함께 기능)
    /// </summary>
    void Refresh_memberElement()
    {
        //Lst_MemberElement 리스트를 dic으로 변환후 dic의 데이터안에 Dic_ExistClanMember 키값에 잇는지 체크 => 즉Dic_ExistClanMember 데이터중에  Lst_MemberElement 가 없는 거 반환
        var noCreatedEle = Dic_ExistClanMember.Where(n => !Lst_MemberElement.ToDictionary(g => g.clan_member.MemIdx, g => g.clan_member).ContainsKey(n.Value.MemIdx));

        if (noCreatedEle.Count() > 0)
        {
            foreach (var ele in noCreatedEle)
            {
                UIItem_MemberElement _element = UI_Manager.Getsingleton.CreatUI(UIITEM.ITEM_CLANMEMBERELEMENT, Lst_TrContent[(int)ClanUI_Type.Manage]) as UIItem_MemberElement;
                _element.Set_Element(ele.Value, ele.Value.CnRank == (byte)CLAN_MEMBER_TYPE.MASTER);

                Lst_MemberElement.Add(_element);
            }
        }


        //클랜탈퇴, 클랜강퇴 등 사라진 멤버에 대해 기존생성된 elememt 삭제 해준다
        var deletedEle = Lst_MemberElement.Where(n => !Dic_ExistClanMember.ContainsKey(n.clan_member.MemIdx));

        if (deletedEle.Count() > 0)
        {
            for (int i = 0; i < deletedEle.ToList().Count; i++)
            {
                Destroy(deletedEle.ToList()[i].gameObject);
                Lst_MemberElement.Remove(deletedEle.ToList()[i]);
            }
        }


        //member 데이터 다시받고 element 정보 갱신한다.

        for (int i = 0; i < Lst_MemberElement.Count; i++)
        {
            foreach (var member in Dic_ExistClanMember)
            {
                if (Lst_MemberElement[i].clan_member.MemIdx == member.Value.MemIdx)
                {
                    Lst_MemberElement[i].Set_Element(member.Value, member.Value.CnRank == (byte)CLAN_MEMBER_TYPE.MASTER);
                }
            }
        }

        //정렬 다시한다
        Sort_memberList(Lst_MemberElement);
    }