1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-26 18:32:56 +08:00
osu-lazer/osu.Game/Users/User.cs

158 lines
3.6 KiB
C#
Raw Normal View History

2018-04-13 17:19:50 +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
using System;
using Newtonsoft.Json;
using osu.Framework.Configuration;
namespace osu.Game.Users
{
public class User
{
[JsonProperty(@"id")]
public long Id = 1;
[JsonProperty(@"join_date")]
public DateTimeOffset JoinDate;
[JsonProperty(@"username")]
public string Username;
[JsonProperty(@"country")]
public Country Country;
public Bindable<UserStatus> Status = new Bindable<UserStatus>();
//public Team Team;
[JsonProperty(@"profile_colour")]
public string Colour;
[JsonProperty(@"avatar_url")]
public string AvatarUrl;
[JsonProperty(@"cover_url")]
public string CoverUrl
{
get { return Cover?.Url; }
set { Cover = new UserCover { Url = value }; }
}
[JsonProperty(@"cover")]
public UserCover Cover;
public class UserCover
{
[JsonProperty(@"custom_url")]
public string CustomUrl;
[JsonProperty(@"url")]
public string Url;
[JsonProperty(@"id")]
public int? Id;
}
[JsonProperty(@"is_admin")]
public bool IsAdmin;
[JsonProperty(@"is_supporter")]
public bool IsSupporter;
[JsonProperty(@"is_gmt")]
public bool IsGMT;
[JsonProperty(@"is_qat")]
public bool IsQAT;
[JsonProperty(@"is_bng")]
public bool IsBNG;
[JsonProperty(@"is_active")]
public bool Active;
[JsonProperty(@"interests")]
public string Interests;
[JsonProperty(@"occupation")]
public string Occupation;
[JsonProperty(@"title")]
public string Title;
[JsonProperty(@"location")]
public string Location;
2018-08-26 11:31:33 +08:00
[JsonProperty(@"last_visit")]
public DateTimeOffset? LastVisit;
2018-04-13 17:19:50 +08:00
[JsonProperty(@"twitter")]
public string Twitter;
[JsonProperty(@"lastfm")]
public string Lastfm;
[JsonProperty(@"skype")]
public string Skype;
[JsonProperty(@"discord")]
public string Discord;
2018-04-13 17:19:50 +08:00
[JsonProperty(@"website")]
public string Website;
[JsonProperty(@"post_count")]
public int PostCount;
2018-04-13 17:19:50 +08:00
[JsonProperty(@"playstyle")]
public string[] PlayStyle;
[JsonProperty(@"playmode")]
public string PlayMode;
[JsonProperty(@"profile_order")]
public string[] ProfileOrder;
[JsonProperty(@"kudosu")]
public KudosuCount Kudosu;
public class KudosuCount
{
[JsonProperty(@"total")]
public int Total;
[JsonProperty(@"available")]
public int Available;
}
[JsonProperty(@"statistics")]
public UserStatistics Statistics;
public class RankHistoryData
{
[JsonProperty(@"mode")]
public string Mode;
[JsonProperty(@"data")]
public int[] Data;
}
[JsonProperty(@"rankHistory")]
public RankHistoryData RankHistory;
2018-04-16 05:44:59 +08:00
[JsonProperty("badges")]
public Badge[] Badges;
2018-04-13 17:19:50 +08:00
public override string ToString() => Username;
/// <summary>
/// A user instance for displaying locally created system messages.
/// </summary>
2018-09-13 13:03:21 +08:00
public static readonly User SYSTEM_USER = new User
{
Username = "system",
Id = 0
};
2018-04-13 17:19:50 +08:00
}
}