]> git.deb.at Git - rhonda/impostor.git/commitdiff
Expose RoleType in api
authorjs6pak <kubastaron@hotmail.com>
Fri, 6 Jan 2023 18:11:09 +0000 (19:11 +0100)
committerjs6pak <kubastaron@hotmail.com>
Fri, 6 Jan 2023 18:38:33 +0000 (19:38 +0100)
src/Impostor.Api/Net/Inner/Objects/IInnerPlayerInfo.cs
src/Impostor.Plugins.Example/Handlers/GameEventListener.cs

index 368f3a10ebeeccdfdf478073173a0abfb18d675d..eb3654a1a94fe49d2ca601fda5144851bcfb980e 100644 (file)
@@ -12,6 +12,11 @@ namespace Impostor.Api.Net.Inner.Objects
         /// </summary>
         string PlayerName { get; }
 
+        /// <summary>
+        ///     Gets the role type of the player.
+        /// </summary>
+        RoleTypes? RoleType { get; }
+
         /// <summary>
         ///     Gets a value indicating whether the player is an impostor.
         /// </summary>
index 39bcb0148b219dcaa4424199981e78b39477f843..404e0a8136b89f6f9ae64054456bd83e265a7671 100644 (file)
@@ -52,7 +52,7 @@ namespace Impostor.Plugins.Example.Handlers
             {
                 var info = player.Character!.PlayerInfo;
 
-                _logger.LogInformation("- {player} is {role}", info.PlayerName, info.IsImpostor ? "an impostor" : "a crewmate");
+                _logger.LogInformation("- {player} is {role}", info.PlayerName, info.RoleType);
             }
         }