osu/osu.Game/Users/User.cs

147 lines
3.4 KiB
C#
Raw Normal View History

2018-01-05 11:21:19 +00:00
// Copyright (c) 2007-2018 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
2017-06-15 13:13:40 +00:00
using System;
2017-03-27 15:04:07 +00:00
using Newtonsoft.Json;
using osu.Framework.Configuration;
2017-03-27 15:04:07 +00:00
namespace osu.Game.Users
{
public class User
{
2017-03-27 15:04:07 +00:00
[JsonProperty(@"id")]
public long Id = 1;
2017-06-16 12:32:11 +00:00
[JsonProperty(@"join_date")]
public DateTimeOffset JoinDate;
2017-06-15 13:13:40 +00:00
2017-03-27 15:04:07 +00:00
[JsonProperty(@"username")]
public string Username;
2017-03-27 15:04:07 +00:00
2017-04-20 10:48:53 +00:00
[JsonProperty(@"country")]
public Country Country;
2017-03-27 15:04:07 +00:00
public Bindable<UserStatus> Status = new Bindable<UserStatus>();
2017-06-15 13:13:40 +00:00
[JsonProperty(@"age")]
2017-06-15 15:25:13 +00:00
public int? Age;
2017-06-15 13:13:40 +00:00
2017-05-30 08:12:11 +00:00
public int GlobalRank;
public int CountryRank;
//public Team Team;
2017-03-27 15:04:07 +00:00
2017-04-20 10:48:53 +00:00
[JsonProperty(@"profile_colour")]
2017-03-27 15:04:07 +00:00
public string Colour;
2017-04-11 05:00:21 +00:00
2017-04-20 10:48:53 +00:00
[JsonProperty(@"avatar_url")]
public string AvatarUrl;
2017-04-20 10:48:53 +00:00
[JsonProperty(@"cover_url")]
2018-01-04 07:15:11 +00:00
public string CoverUrl
{
get { return Cover?.Url; }
set { Cover = new UserCover { Url = value }; }
}
2017-04-20 10:48:53 +00:00
2018-01-04 07:15:11 +00:00
[JsonProperty(@"cover")]
public UserCover Cover;
public class UserCover
{
2017-04-20 10:48:53 +00:00
[JsonProperty(@"custom_url")]
public string CustomUrl;
[JsonProperty(@"url")]
public string Url;
[JsonProperty(@"id")]
public int? Id;
}
2017-06-15 13:13:40 +00:00
[JsonProperty(@"isAdmin")]
public bool IsAdmin;
[JsonProperty(@"isSupporter")]
public bool IsSupporter;
[JsonProperty(@"isGMT")]
public bool IsGMT;
[JsonProperty(@"isQAT")]
public bool IsQAT;
[JsonProperty(@"isBNG")]
public bool IsBNG;
[JsonProperty(@"is_active")]
public bool Active;
[JsonProperty(@"interests")]
2017-12-08 11:54:36 +00:00
public string Interests;
2017-06-15 13:13:40 +00:00
[JsonProperty(@"occupation")]
public string Occupation;
[JsonProperty(@"title")]
public string Title;
[JsonProperty(@"location")]
public string Location;
[JsonProperty(@"lastvisit")]
public DateTimeOffset LastVisit;
[JsonProperty(@"twitter")]
public string Twitter;
[JsonProperty(@"lastfm")]
public string Lastfm;
[JsonProperty(@"skype")]
public string Skype;
[JsonProperty(@"website")]
public string Website;
[JsonProperty(@"playstyle")]
public string[] PlayStyle;
[JsonProperty(@"playmode")]
public string PlayMode;
[JsonProperty(@"profileOrder")]
public string[] ProfileOrder;
[JsonProperty(@"kudosu")]
public KudosuCount Kudosu;
public class KudosuCount
{
[JsonProperty(@"total")]
public int Total;
[JsonProperty(@"available")]
public int Available;
}
[JsonProperty(@"statistics")]
2017-06-15 13:13:40 +00:00
public UserStatistics Statistics;
2017-06-25 16:38:00 +00:00
public class RankHistoryData
2017-06-25 16:38:00 +00:00
{
[JsonProperty(@"mode")]
public string Mode;
[JsonProperty(@"data")]
public int[] Data;
}
[JsonProperty(@"rankHistory")]
public RankHistoryData RankHistory;
public override string ToString() => Username;
}
}