[Feature Request] Event args
See original GitHub issueHeres an example: Instead of OnDamagedPlayer(Player player, Player attacker, (ref) float damage)
, use OnDamagedPlayer(OnDamagedPlayerArgs ev)
where
public class OnDamagedPlayerArgs
{
public Player Player { get; }
public Player Attacker { get; }
public float Damage { get; set; }
}
You could also include a bool Cancel { get; set; }
for cancelling instead of using return values, which allows for other event handler to interact with already cancelled events. Similarly you can also use the set accessors to change variables such as damage without needing to declare variables as ref
.
Issue Analytics
- State:
- Created 2 months ago
- Comments:8 (2 by maintainers)
Top Results From Across the Web
Feature request: Expand event filters to support multiple ...
Feature request : Expand event filters to support multiple events. ... filter. topics would be mutually exclusive with the current event / args...
Read more >EventArgs Class (System)
Represents the base class for classes that contain event data, and provides a value to use for events that do not include event...
Read more >SendingRequestEventArgs Class (Microsoft.OData.Client)
Event args for the event fired before executing a web request. Gives a chance to customize or replace the request object to be...
Read more >Improve event handling - Feature Requests
If a plugin or platform generates an event, that should bubble up into HA and present as an HA event with all the...
Read more >Showing the Feature Requests List
The following method can be used to display the Feature Requests page to your users. Once you display the page, the users can...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
not related to concurrent fork PR, it’s from @muji2498 's work,
‘Heres an example:’