sharp-chat/SharpChat.DataProvider.Misuzu/Users/MisuzuUser.cs

31 lines
898 B
C#
Raw Permalink Normal View History

2022-08-30 15:05:29 +00:00
using SharpChat.Users;
using SharpChat.Users.Remote;
using System.Text.Json.Serialization;
namespace SharpChat.DataProvider.Misuzu.Users {
public class MisuzuUser : IRemoteUser {
[JsonPropertyName(@"user_id")]
public long UserId { get; set; }
[JsonPropertyName(@"username")]
public string UserName { get; set; }
[JsonPropertyName(@"colour_raw")]
public int ColourRaw { get; set; }
[JsonIgnore]
public Colour Colour => new(ColourRaw);
[JsonPropertyName(@"rank")]
public int Rank { get; set; }
[JsonPropertyName(@"perms")]
public UserPermissions Permissions { get; set; }
public bool Equals(IUser other)
=> other is MisuzuUser && other.UserId == UserId;
public bool Equals(IRemoteUser other)
=> other is MisuzuUser && other.UserId == UserId;
}
}