Esempio n. 1
0
 public LadderPlayerModel(LadderApiEntry entry)
 {
     Name              = entry.Character.Name;
     Level             = entry.Character.Level;
     Online            = entry.Online;
     Dead              = entry.Dead;
     Challenges        = entry.Account.Challenges.Total;
     Account           = entry.Account.Name;
     Experience        = entry.Character.Experience;
     ExperiencePerHour = 0;
     Rank              = new LadderPlayerRankModel()
     {
         Overall = entry.Rank
     };
     Depth = new LadderPlayerDepthModel()
     {
         Solo  = entry.Character.Depth != null ? entry.Character.Depth.Solo : 0,
         Group = entry.Character.Depth != null ? entry.Character.Depth.@default : 0
     };
     Twitch  = entry.Account.Twitch?.Name;
     Class   = entry.Character.Class;
     Updated = DateTime.Now;
 }
Esempio n. 2
0
        public LadderPlayerModel(LadderApiEntry entry, string sortmode)
        {
            Name              = entry.Character.Name;
            Level             = entry.Character.Level;
            Online            = entry.Online;
            Dead              = entry.Dead;
            Challenges        = entry.Account.Challenges.Total;
            Account           = entry.Account.Name;
            Experience        = entry.Character.Experience;
            ExperiencePerHour = 0;
            Rank              = new LadderPlayerRankModel();
            Depth             = new LadderPlayerDepthModel()
            {
                Solo  = entry.Character.Depth != null ? entry.Character.Depth.Solo : 0,
                Group = entry.Character.Depth != null ? entry.Character.Depth.@default : 0
            };
            Twitch  = entry.Account.Twitch?.Name;
            Class   = entry.Character.Class;
            Updated = DateTime.Now;


            switch (sortmode)
            {
            case null:
                Rank.Overall = entry.Rank;
                break;

            case "depth":
                Depth.GroupRank = entry.Rank;
                break;

            case "depthsolo":
                Depth.SoloRank = entry.Rank;
                break;
            }
        }