Ejemplo n.º 1
0
 public void CalcUnit(List <UnitListWindow.Data> list)
 {
     if (!this.IsType(UnitListSortWindow.SelectType.TIME))
     {
         UnitListSortWindow.SelectType section = this.GetSection();
         for (int index = 0; index < list.Count; ++index)
         {
             list[index].RefreshSortPriority(section);
         }
         SortUtility.StableSort <UnitListWindow.Data>(list, (Comparison <UnitListWindow.Data>)((p1, p2) =>
         {
             int num = p1.sortPriority.CompareTo(p2.sortPriority);
             if (num == 0)
             {
                 num = (p1.param == null ? string.Empty : p1.param.iname).CompareTo(p2.param == null ? string.Empty : p2.param.iname);
             }
             return(num);
         }));
     }
     if (this.GetAlignment() != UnitListSortWindow.SelectType.KOUJYUN)
     {
         return;
     }
     list.Reverse();
 }
Ejemplo n.º 2
0
        public void InitializeContentList()
        {
            this.ReleaseContentList();
            if (!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.m_ContentController, (UnityEngine.Object)null))
            {
                return;
            }
            this.m_ContentSource = new FriendPresentWantWindow.Content.ItemSource();
            FriendPresentItemParam[] presentItemParams = MonoSingleton <GameManager> .Instance.MasterParam.GetFriendPresentItemParams();

            List <FriendPresentItemParam> list = new List <FriendPresentItemParam>();

            for (int index = 0; index < presentItemParams.Length; ++index)
            {
                if (!presentItemParams[index].IsDefault() && presentItemParams[index].IsValid(Network.GetServerTime()))
                {
                    list.Add(presentItemParams[index]);
                }
            }
            long serverTime = Network.GetServerTime();

            SortUtility.StableSort <FriendPresentItemParam>(list, (Comparison <FriendPresentItemParam>)((p1, p2) => (!p1.HasTimeLimit() ? long.MaxValue : p1.GetRestTime(serverTime)).CompareTo(!p2.HasTimeLimit() ? long.MaxValue : p2.GetRestTime(serverTime))));
            for (int index = 0; index < list.Count; ++index)
            {
                FriendPresentWantWindow.Content.ItemSource.ItemParam itemParam = new FriendPresentWantWindow.Content.ItemSource.ItemParam(list[index]);
                if (itemParam.IsValid())
                {
                    this.m_ContentSource.Add(itemParam);
                }
            }
            this.m_ContentController.Initialize((ContentSource)this.m_ContentSource, Vector2.get_zero());
        }
Ejemplo n.º 3
0
        public void InitializeContentList()
        {
            this.ReleaseContentList();
            if (!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.m_ContentController, (UnityEngine.Object)null))
            {
                return;
            }
            // ISSUE: object of a compiler-generated type is created
            // ISSUE: variable of a compiler-generated type
            FriendPresentWantWindow.\u003CInitializeContentList\u003Ec__AnonStorey331 listCAnonStorey331 = new FriendPresentWantWindow.\u003CInitializeContentList\u003Ec__AnonStorey331();
            this.m_ContentSource = new FriendPresentWantWindow.Content.ItemSource();
            FriendPresentItemParam[] presentItemParams = MonoSingleton <GameManager> .Instance.MasterParam.GetFriendPresentItemParams();

            List <FriendPresentItemParam> list = new List <FriendPresentItemParam>();

            for (int index = 0; index < presentItemParams.Length; ++index)
            {
                if (!presentItemParams[index].IsDefault() && presentItemParams[index].IsValid(Network.GetServerTime()))
                {
                    list.Add(presentItemParams[index]);
                }
            }
            // ISSUE: reference to a compiler-generated field
            listCAnonStorey331.serverTime = Network.GetServerTime();
            // ISSUE: reference to a compiler-generated method
            SortUtility.StableSort <FriendPresentItemParam>(list, new Comparison <FriendPresentItemParam>(listCAnonStorey331.\u003C\u003Em__378));
            for (int index = 0; index < list.Count; ++index)
            {
                FriendPresentWantWindow.Content.ItemSource.ItemParam itemParam = new FriendPresentWantWindow.Content.ItemSource.ItemParam(list[index]);
                if (itemParam.IsValid())
                {
                    this.m_ContentSource.Add(itemParam);
                }
            }
            this.m_ContentController.Initialize((ContentSource)this.m_ContentSource, Vector2.get_zero());
        }
        public void InitializeContentList()
        {
            this.ReleaseContentList();
            if (!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.m_ContentController, (UnityEngine.Object)null))
            {
                return;
            }
            this.m_ContentSource = new MultiInvitationSendWindow.Content.ItemSource();
            List <FriendData> list     = new List <FriendData>((IEnumerable <FriendData>)MonoSingleton <GameManager> .Instance.Player.Friends);
            MyPhoton          instance = PunMonoSingleton <MyPhoton> .Instance;

            if (UnityEngine.Object.op_Inequality((UnityEngine.Object)instance, (UnityEngine.Object)null))
            {
                List <MyPhoton.MyPlayer> roomPlayerList = instance.GetRoomPlayerList();
                for (int index1 = 0; index1 < roomPlayerList.Count; ++index1)
                {
                    if (roomPlayerList[index1] != null && !string.IsNullOrEmpty(roomPlayerList[index1].json))
                    {
                        // ISSUE: object of a compiler-generated type is created
                        // ISSUE: variable of a compiler-generated type
                        MultiInvitationSendWindow.\u003CInitializeContentList\u003Ec__AnonStorey34A listCAnonStorey34A = new MultiInvitationSendWindow.\u003CInitializeContentList\u003Ec__AnonStorey34A();
                        // ISSUE: reference to a compiler-generated field
                        listCAnonStorey34A.param = JSON_MyPhotonPlayerParam.Parse(roomPlayerList[index1].json);
                        // ISSUE: reference to a compiler-generated field
                        if (listCAnonStorey34A.param != null)
                        {
                            // ISSUE: reference to a compiler-generated method
                            int index2 = list.FindIndex(new Predicate <FriendData>(listCAnonStorey34A.\u003C\u003Em__3AA));
                            if (index2 != -1)
                            {
                                list.RemoveAt(index2);
                            }
                        }
                    }
                }
            }
            for (int index = 0; index < list.Count; ++index)
            {
                // ISSUE: object of a compiler-generated type is created
                // ISSUE: variable of a compiler-generated type
                MultiInvitationSendWindow.\u003CInitializeContentList\u003Ec__AnonStorey34B listCAnonStorey34B = new MultiInvitationSendWindow.\u003CInitializeContentList\u003Ec__AnonStorey34B();
                // ISSUE: reference to a compiler-generated field
                listCAnonStorey34B.data = list[index];
                bool flag = false;
                // ISSUE: reference to a compiler-generated field
                if (listCAnonStorey34B.data != null)
                {
                    // ISSUE: reference to a compiler-generated method
                    if (MultiInvitationSendWindow.m_Invited.FindIndex(new Predicate <string>(listCAnonStorey34B.\u003C\u003Em__3AB)) != -1)
                    {
                        flag = true;
                    }
                    else
                    {
                        // ISSUE: reference to a compiler-generated field
                        if (!listCAnonStorey34B.data.MultiPush)
                        {
                            flag = true;
                        }
                        else
                        {
                            // ISSUE: reference to a compiler-generated field
                            if (TimeManager.GetUnixSec(DateTime.Now) - listCAnonStorey34B.data.LastLogin > 86400L)
                            {
                                flag = true;
                            }
                        }
                    }
                }
                else
                {
                    flag = true;
                }
                if (flag)
                {
                    list.RemoveAt(index);
                    --index;
                }
            }
            SortUtility.StableSort <FriendData>(list, (Comparison <FriendData>)((p1, p2) => (!p1.IsFavorite ? p1.LastLogin : long.MaxValue).CompareTo(!p2.IsFavorite ? p2.LastLogin : long.MaxValue)));
            list.Reverse();
            for (int index = 0; index < list.Count; ++index)
            {
                FriendData friend = list[index];
                if (friend != null)
                {
                    MultiInvitationSendWindow.Content.ItemSource.ItemParam itemParam = new MultiInvitationSendWindow.Content.ItemSource.ItemParam(friend);
                    if (itemParam.IsValid())
                    {
                        this.m_ContentSource.Add(itemParam);
                    }
                }
            }
            this.m_ContentController.Initialize((ContentSource)this.m_ContentSource, Vector2.get_zero());
        }
        public void InitializeContentList()
        {
            this.ReleaseContentList();
            if (!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.m_ContentController, (UnityEngine.Object)null))
            {
                return;
            }
            this.m_ContentSource = new MultiInvitationSendWindow.Content.ItemSource();
            List <FriendData> list     = new List <FriendData>((IEnumerable <FriendData>)MonoSingleton <GameManager> .Instance.Player.Friends);
            MyPhoton          instance = PunMonoSingleton <MyPhoton> .Instance;

            if (UnityEngine.Object.op_Inequality((UnityEngine.Object)instance, (UnityEngine.Object)null))
            {
                List <MyPhoton.MyPlayer> roomPlayerList = instance.GetRoomPlayerList();
                for (int index1 = 0; index1 < roomPlayerList.Count; ++index1)
                {
                    if (roomPlayerList[index1] != null && !string.IsNullOrEmpty(roomPlayerList[index1].json))
                    {
                        JSON_MyPhotonPlayerParam param = JSON_MyPhotonPlayerParam.Parse(roomPlayerList[index1].json);
                        if (param != null)
                        {
                            int index2 = list.FindIndex((Predicate <FriendData>)(prop => prop.UID == param.UID));
                            if (index2 != -1)
                            {
                                list.RemoveAt(index2);
                            }
                        }
                    }
                }
            }
            for (int index = 0; index < list.Count; ++index)
            {
                FriendData data = list[index];
                bool       flag = false;
                if (data != null)
                {
                    if (MultiInvitationSendWindow.m_Invited.FindIndex((Predicate <string>)(prop => prop == data.UID)) != -1)
                    {
                        flag = true;
                    }
                    else if (!data.MultiPush)
                    {
                        flag = true;
                    }
                    else if (TimeManager.GetUnixSec(DateTime.Now) - data.LastLogin > 86400L)
                    {
                        flag = true;
                    }
                }
                else
                {
                    flag = true;
                }
                if (flag)
                {
                    list.RemoveAt(index);
                    --index;
                }
            }
            SortUtility.StableSort <FriendData>(list, (Comparison <FriendData>)((p1, p2) => (!p1.IsFavorite ? p1.LastLogin : long.MaxValue).CompareTo(!p2.IsFavorite ? p2.LastLogin : long.MaxValue)));
            list.Reverse();
            for (int index = 0; index < list.Count; ++index)
            {
                FriendData friend = list[index];
                if (friend != null)
                {
                    MultiInvitationSendWindow.Content.ItemSource.ItemParam itemParam = new MultiInvitationSendWindow.Content.ItemSource.ItemParam(friend);
                    if (itemParam.IsValid())
                    {
                        this.m_ContentSource.Add(itemParam);
                    }
                }
            }
            this.m_ContentController.Initialize((ContentSource)this.m_ContentSource, Vector2.get_zero());
        }