-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from ErisApps/bugfix/Fix_curator_support
Add support for new Curator object
- Loading branch information
Showing
3 changed files
with
43 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
using System; | ||
using Newtonsoft.Json; | ||
|
||
namespace BeatSaverSharp.Models | ||
{ | ||
public class Curator : IEquatable<Curator> | ||
{ | ||
/// <summary> | ||
/// Id of the curator. | ||
/// </summary> | ||
[JsonProperty("id")] | ||
public int Id { get; internal set; } | ||
|
||
/// <summary> | ||
/// Name of the curator. | ||
/// </summary> | ||
[JsonProperty("name")] | ||
public string Name { get; internal set; } = null!; | ||
|
||
/// <summary> | ||
/// Link of the avatar of the curator. | ||
/// </summary> | ||
[JsonProperty("avatar")] | ||
public string Avatar { get; internal set; } = null!; | ||
|
||
/// <summary> | ||
/// User account type of the curator. | ||
/// </summary> | ||
[JsonProperty("type")] | ||
public string Type { get; internal set; } = null!; | ||
|
||
internal Curator() { } | ||
|
||
// Equality Methods | ||
|
||
public bool Equals(Curator? other) => Id == other?.Id; | ||
public override int GetHashCode() => Id.GetHashCode(); | ||
public override bool Equals(object? obj) => Equals(obj as Curator); | ||
public static bool operator ==(Curator left, Curator right) => Equals(left, right); | ||
public static bool operator !=(Curator left, Curator right) => !Equals(left, right); | ||
} | ||
} |