Poor readability for `Notify` function in `EventManager.cs`
valkyrienyanko opened this issue · 0 comments
valkyrienyanko commented
EventManager.cs public void Notify(TEvent eventType, params object[] args)
This is easy to use but when looking at it on the other end not so much.
GameManager.Events.AddListener(nameof(UIPlayerList), Event.OnGameClientJoined, (args) =>
{
AddPlayer((byte)args[0], (string)args[1]);
});
Who would have known args[0]
is the player ID and args[1]
is the player username. You would have to look at where this event was triggered to know this. GameManager.Events.Notify(Event.OnGameClientJoined, Id, Username);
This isn't great. I wish there was a more clear way of doing this.