Skip to content

Commit

Permalink
feat(clrcore-v2): add implicit conversion from int to CString in Player
Browse files Browse the repository at this point in the history
  • Loading branch information
geofmigliacci committed Sep 27, 2024
1 parent 49406c4 commit 736ab54
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion code/client/clrcore-v2/Shared/Player.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,22 @@ public abstract class Player
internal Player()
{
}

/// <summary>
/// Gets the handle of this player
/// </summary>
public int Handle => int.Parse(m_handle);

/// <summary>
/// Converts a <see cref="Player"/> to a <see cref="CString"/> using its <see langword="int"/> <see cref="Handle"/>.
/// </summary>
/// <param name="player">
/// The <see cref="Player"/> to convert.
/// </param>
public static implicit operator CString(Player player)
{
return player.Handle.ToString();
}
#else
public abstract class Player : Core.Native.Input.Primitive
{
Expand Down

0 comments on commit 736ab54

Please sign in to comment.