public string GetSortingKey()
        {
            if (SortCategory < (int)SortCats.Uncategorized)
            {
                return(SortCategory.ToString("00000") + UserName ?? string.Empty); //for ChatControl's search-filter only
            }
            var name = string.Empty;

            if (UserBattleStatus != null)
            {
                name = UserBattleStatus.Name;
                if (UserBattleStatus.IsSpectator)
                {
                    SortCategory = (int)PlayerListItem.SortCats.Spectators;
                }
                else
                {
                    SortCategory = UserBattleStatus.AllyNumber * 2 + 1 + (int)PlayerListItem.SortCats.Uncategorized;
                }
            }
            else if (BotBattleStatus != null)
            {
                name         = BotBattleStatus.Name;
                SortCategory = BotBattleStatus.AllyNumber * 2 + 1 + (int)PlayerListItem.SortCats.Uncategorized;
            }
            else if (UserName != null)
            {
                name = UserName;
            }
            else if (Title != null)
            {
                name = Title;
            }
            return(SortCategory.ToString("00000") + name);
        }
        public override string ToString()
        {
            var name = string.Empty;

            if (UserName != null)
            {
                name = UserName;
            }
            else if (UserBattleStatus != null)
            {
                name = UserBattleStatus.Name;
            }
            else if (Title != null)
            {
                name = Title;
            }
            return(SortCategory.ToString("00000") + name);
        }
Beispiel #3
0
        public override string ToString()
        {
            var name = string.Empty;

            if (MissionSlot != null)
            {
                SortCategory = MissionSlot.TeamID;
                name         = MissionSlot.TeamName;
            }
            else if (UserBattleStatus != null)
            {
                name = UserBattleStatus.Name;
                if (UserBattleStatus.IsSpectator)
                {
                    SortCategory = 101;
                }
                else
                {
                    SortCategory = UserBattleStatus.AllyNumber * 2 + 1;
                }
            }
            else if (BotBattleStatus != null)
            {
                name         = BotBattleStatus.Name;
                SortCategory = BotBattleStatus.AllyNumber * 2 + 1;
            }
            else if (UserName != null)
            {
                name = UserName;
            }
            else if (Title != null)
            {
                name = Title;
            }
            return(SortCategory.ToString("00000") + name);
        }