1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 21:47:25 +08:00
osu-lazer/osu.Game/Users/User.cs

143 lines
3.4 KiB
C#
Raw Normal View History

2018-01-05 19:21:19 +08: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 21:13:40 +08:00
using System;
2017-03-27 23:04:07 +08:00
using Newtonsoft.Json;
using osu.Framework.Configuration;
2017-03-27 23:04:07 +08:00
namespace osu.Game.Users
{
public class User
{
2017-03-27 23:04:07 +08:00
[JsonProperty(@"id")]
public long Id = 1;
2017-06-16 20:32:11 +08:00
[JsonProperty(@"join_date")]
public DateTimeOffset JoinDate;
2017-06-15 21:13:40 +08:00
2017-03-27 23:04:07 +08:00
[JsonProperty(@"username")]
public string Username;
2017-03-27 23:04:07 +08:00
2017-04-20 18:48:53 +08:00
[JsonProperty(@"country")]
public Country Country;
2017-03-27 23:04:07 +08:00
public Bindable<UserStatus> Status = new Bindable<UserStatus>();
2017-06-15 21:13:40 +08:00
[JsonProperty(@"age")]
2017-06-15 23:25:13 +08:00
public int? Age;
2017-06-15 21:13:40 +08:00
//public Team Team;
2017-03-27 23:04:07 +08:00
2017-04-20 18:48:53 +08:00
[JsonProperty(@"profile_colour")]
2017-03-27 23:04:07 +08:00
public string Colour;
2017-04-11 13:00:21 +08:00
2017-04-20 18:48:53 +08:00
[JsonProperty(@"avatar_url")]
public string AvatarUrl;
2017-04-20 18:48:53 +08:00
[JsonProperty(@"cover_url")]
2018-01-04 15:15:11 +08:00
public string CoverUrl
{
get { return Cover?.Url; }
set { Cover = new UserCover { Url = value }; }
}
2017-04-20 18:48:53 +08:00
2018-01-04 15:15:11 +08:00
[JsonProperty(@"cover")]
public UserCover Cover;
public class UserCover
{
2017-04-20 18:48:53 +08:00
[JsonProperty(@"custom_url")]
public string CustomUrl;
[JsonProperty(@"url")]
public string Url;
[JsonProperty(@"id")]
public int? Id;
}
2017-06-15 21:13:40 +08:00
[JsonProperty(@"is_admin")]
2017-06-15 21:13:40 +08:00
public bool IsAdmin;
[JsonProperty(@"is_supporter")]
2017-06-15 21:13:40 +08:00
public bool IsSupporter;
[JsonProperty(@"is_gmt")]
2017-06-15 21:13:40 +08:00
public bool IsGMT;
[JsonProperty(@"is_qat")]
2017-06-15 21:13:40 +08:00
public bool IsQAT;
[JsonProperty(@"is_bng")]
2017-06-15 21:13:40 +08:00
public bool IsBNG;
[JsonProperty(@"is_active")]
public bool Active;
[JsonProperty(@"interests")]
2017-12-08 19:54:36 +08:00
public string Interests;
2017-06-15 21:13:40 +08: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(@"profile_order")]
2017-06-15 21:13:40 +08:00
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 21:13:40 +08:00
public UserStatistics Statistics;
2017-06-26 00:38:00 +08:00
public class RankHistoryData
2017-06-26 00:38:00 +08:00
{
[JsonProperty(@"mode")]
public string Mode;
[JsonProperty(@"data")]
public int[] Data;
}
[JsonProperty(@"rankHistory")]
public RankHistoryData RankHistory;
public override string ToString() => Username;
}
}