From: miniduikboot Date: Tue, 1 Apr 2025 21:49:46 +0000 (+0200) Subject: Add GameTags enum X-Git-Tag: v1.10.3~11^2~1 X-Git-Url: https://git.deb.at/?a=commitdiff_plain;h=723495e3907ff890a79ac15639dff37c2b4b4185;p=rhonda%2Fimpostor.git Add GameTags enum Can't be generated from game files at the moment unfortunately --- diff --git a/src/Impostor.Api/Innersloth/GameOptions/GameTags.cs b/src/Impostor.Api/Innersloth/GameOptions/GameTags.cs new file mode 100644 index 0000000..b7db653 --- /dev/null +++ b/src/Impostor.Api/Innersloth/GameOptions/GameTags.cs @@ -0,0 +1,14 @@ +namespace Impostor.Api.Innersloth.GameOptions; + +// TODO: generate this enum based on game data + +/// +/// Tag that can be added to indicate the expected skill level of players in this lobby. +/// +public enum GameTags +{ + None = 0, + Beginner = 1, + Intermediate = 2, + Expert = 3, +} diff --git a/src/Impostor.Api/Innersloth/GameOptions/HideNSeekGameOptions.cs b/src/Impostor.Api/Innersloth/GameOptions/HideNSeekGameOptions.cs index 10df425..a3d494a 100644 --- a/src/Impostor.Api/Innersloth/GameOptions/HideNSeekGameOptions.cs +++ b/src/Impostor.Api/Innersloth/GameOptions/HideNSeekGameOptions.cs @@ -96,7 +96,7 @@ public class HideNSeekGameOptions : IGameOptions /// /// Gets or sets the experience level of people in the lobby: Beginner, Intermediate or Expert. /// - public byte Tag { get; set; } = 0; + public GameTags Tag { get; set; } = 0; public static HideNSeekGameOptions Deserialize(IMessageReader reader, byte version) { @@ -140,7 +140,7 @@ public class HideNSeekGameOptions : IGameOptions if (Version >= 9) { - Tag = reader.ReadByte(); + Tag = (GameTags)reader.ReadByte(); } if (Version > LatestVersion) diff --git a/src/Impostor.Api/Innersloth/GameOptions/NormalGameOptions.cs b/src/Impostor.Api/Innersloth/GameOptions/NormalGameOptions.cs index 61fdd5f..4488b17 100644 --- a/src/Impostor.Api/Innersloth/GameOptions/NormalGameOptions.cs +++ b/src/Impostor.Api/Innersloth/GameOptions/NormalGameOptions.cs @@ -131,7 +131,7 @@ public class NormalGameOptions : IGameOptions /// /// Gets or sets the experience level of people in the lobby: Beginner, Intermediate or Expert. /// - public byte Tag { get; set; } = 0; + public GameTags Tag { get; set; } = 0; public RoleOptionsCollection RoleOptions { get; set; } @@ -180,7 +180,7 @@ public class NormalGameOptions : IGameOptions if (Version >= 9) { - Tag = reader.ReadByte(); + Tag = (GameTags)reader.ReadByte(); } RoleOptions.Deserialize(reader);