]> git.deb.at Git - rhonda/impostor.git/commitdiff
Add GameTags enum
authorminiduikboot <mini@duikbo.at>
Tue, 1 Apr 2025 21:49:46 +0000 (23:49 +0200)
committerminiduikboot <mini@duikbo.at>
Tue, 1 Apr 2025 21:49:46 +0000 (23:49 +0200)
Can't be generated from game files at the moment unfortunately

src/Impostor.Api/Innersloth/GameOptions/GameTags.cs [new file with mode: 0644]
src/Impostor.Api/Innersloth/GameOptions/HideNSeekGameOptions.cs
src/Impostor.Api/Innersloth/GameOptions/NormalGameOptions.cs

diff --git a/src/Impostor.Api/Innersloth/GameOptions/GameTags.cs b/src/Impostor.Api/Innersloth/GameOptions/GameTags.cs
new file mode 100644 (file)
index 0000000..b7db653
--- /dev/null
@@ -0,0 +1,14 @@
+namespace Impostor.Api.Innersloth.GameOptions;
+
+// TODO: generate this enum based on game data
+
+/// <summary>
+/// Tag that can be added to indicate the expected skill level of players in this lobby.
+/// </summary>
+public enum GameTags
+{
+    None = 0,
+    Beginner = 1,
+    Intermediate = 2,
+    Expert = 3,
+}
index 10df4259512568fff2e8eddb6759e7a259dcb3da..a3d494a89e0591b77a7e38d6ba362f11cb1ddd78 100644 (file)
@@ -96,7 +96,7 @@ public class HideNSeekGameOptions : IGameOptions
     /// <summary>
     ///     Gets or sets the experience level of people in the lobby: Beginner, Intermediate or Expert.
     /// </summary>
-    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)
index 61fdd5f65f1af03381d95dd2c6d4fd056c13c9ce..4488b1731f26afbe888c3359c1fc1294a4ff2c68 100644 (file)
@@ -131,7 +131,7 @@ public class NormalGameOptions : IGameOptions
     /// <summary>
     ///     Gets or sets the experience level of people in the lobby: Beginner, Intermediate or Expert.
     /// </summary>
-    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);