diff --git a/src/Discord.Net.Core/Entities/Users/Game.cs b/src/Discord.Net.Core/Entities/Users/Game.cs index 3405b0dd4..74484ea93 100644 --- a/src/Discord.Net.Core/Entities/Users/Game.cs +++ b/src/Discord.Net.Core/Entities/Users/Game.cs @@ -1,22 +1,50 @@ -using System.Diagnostics; +using System; +using System.Diagnostics; namespace Discord { + // TODO 2.x: make this a class? [DebuggerDisplay(@"{DebuggerDisplay,nq}")] public struct Game { + // All public string Name { get; } - public string StreamUrl { get; } public StreamType StreamType { get; } + // Streaming + public string StreamUrl { get; } + // Rich + public string Details { get; } + public string State { get; } + public ulong? ApplicationId { get; } + public GameAssets? Assets { get; } + public GameParty? Party { get; } + public GameSecrets? Secrets { get; } + public GameTimestamps? Timestamps { get; } - public Game(string name, string streamUrl, StreamType type) + public Game(string name, string streamUrl = null, StreamType type = StreamType.NotStreaming) + : this(name, streamUrl, type, null, null, null, null, null, null, null) { } + public Game(string name, + string streamUrl, + StreamType type, + string details, + string state, + ulong? applicationId, + GameAssets? assets, + GameParty? party, + GameSecrets? secrets, + GameTimestamps? timestamps) { Name = name; StreamUrl = streamUrl; StreamType = type; + Details = details; + State = state; + ApplicationId = applicationId; + Assets = assets; + Party = party; + Secrets = secrets; + Timestamps = timestamps; } - private Game(string name) - : this(name, null, StreamType.NotStreaming) { } public override string ToString() => Name; private string DebuggerDisplay => StreamUrl != null ? $"{Name} ({StreamUrl})" : Name; diff --git a/src/Discord.Net.Core/Entities/Users/GameAssets.cs b/src/Discord.Net.Core/Entities/Users/GameAssets.cs new file mode 100644 index 000000000..ce8fa2864 --- /dev/null +++ b/src/Discord.Net.Core/Entities/Users/GameAssets.cs @@ -0,0 +1,18 @@ +namespace Discord +{ + public struct GameAssets + { + public string SmallText { get; } + public string SmallImage { get; } + public string LargeText { get; } + public string LargeImage { get; } + + public GameAssets(string smallText, string smallImage, string largeText, string largeImage) + { + SmallText = smallText; + SmallImage = smallImage; + LargeText = largeText; + LargeImage = largeImage; + } + } +} \ No newline at end of file diff --git a/src/Discord.Net.Core/Entities/Users/GameParty.cs b/src/Discord.Net.Core/Entities/Users/GameParty.cs new file mode 100644 index 000000000..0dc5a2ddf --- /dev/null +++ b/src/Discord.Net.Core/Entities/Users/GameParty.cs @@ -0,0 +1,14 @@ +namespace Discord +{ + public struct GameParty + { + public ulong[] Size { get; } + public ulong Id { get; } + + public GameParty(ulong[] size, ulong id) + { + Size = size; + Id = id; + } + } +} \ No newline at end of file diff --git a/src/Discord.Net.Core/Entities/Users/GameSecrets.cs b/src/Discord.Net.Core/Entities/Users/GameSecrets.cs new file mode 100644 index 000000000..e919d40a0 --- /dev/null +++ b/src/Discord.Net.Core/Entities/Users/GameSecrets.cs @@ -0,0 +1,16 @@ +namespace Discord +{ + public struct GameSecrets + { + public string Match { get; } + public string Join { get; } + public string Spectate { get; } + + public GameSecrets(string match, string join, string spectate) + { + Match = match; + Join = join; + Spectate = spectate; + } + } +} \ No newline at end of file diff --git a/src/Discord.Net.Core/Entities/Users/GameTimestamps.cs b/src/Discord.Net.Core/Entities/Users/GameTimestamps.cs new file mode 100644 index 000000000..cf2dbb281 --- /dev/null +++ b/src/Discord.Net.Core/Entities/Users/GameTimestamps.cs @@ -0,0 +1,16 @@ +using System; + +namespace Discord +{ + public struct GameTimestamps + { + public DateTimeOffset Start { get; } + public DateTimeOffset End { get; } + + public GameTimestamps(DateTimeOffset start, DateTimeOffset end) + { + Start = start; + End = end; + } + } +} \ No newline at end of file