Open geofmigliacci opened 1 week ago
This PR adds an implicit conversion from int to CString in the Player class as a quality of life (QoL) improvement on the server side. This allows for direct conversion without the need to explicitly call Handle.ToString().
int
CString
Player
Handle.ToString()
See : https://github.com/thorium-cfx/mono_v2_get_started/issues/37
It might be interesting to add this implicit conversion to other entities as well.
This PR adds an implicit operator CString(Player player). With this change, you can now do the following:
Player p1 = new Player(1); Natives.ThisCoolNative(p1, "hello", 1234); // ThisCoolNative(CString, CString, int)
Server, ScRT: C#
Game builds: Latest
Platforms: Windows
resolves https://github.com/thorium-cfx/mono_v2_get_started/issues/37
Goal of this PR
This PR adds an implicit conversion from
int
toCString
in thePlayer
class as a quality of life (QoL) improvement on the server side. This allows for direct conversion without the need to explicitly callHandle.ToString()
.See : https://github.com/thorium-cfx/mono_v2_get_started/issues/37
It might be interesting to add this implicit conversion to other entities as well.
How is this PR achieving the goal
This PR adds an implicit operator CString(Player player). With this change, you can now do the following:
This PR applies to the following area(s)
Server, ScRT: C#
Successfully tested on
Game builds: Latest
Platforms: Windows
Checklist
Fixes issues
resolves https://github.com/thorium-cfx/mono_v2_get_started/issues/37