Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

scene: Embed Eventhandler to allow for some embedded calls #197

Merged
merged 2 commits into from
Mar 28, 2022

Conversation

Implausiblyfun
Copy link
Contributor

Not sold on this but its the only shortening of methods that seems even slightly reasonable. Unfortunately creating helper functions around the context with it still working on the generic functions doesnt work and the embedded interface doesnt allow for this to be passwed as an eventhandler to binds. So definitely not ideal and we refer to it as ctx.Handler rather than ctx.EventHandler which while shorter seems less descriptive.

The bonus of course is signature for callermap interactions so one can call things like ctx.Register(entity)

Thoughts?

@200sc
Copy link
Contributor

200sc commented Mar 26, 2022

If we rename CallerMap.Reset to Clear, then a Context satisfies the property of having no ambiguous method names in its embedded types, so you can then do event.Bind(ctx, ...

@Implausiblyfun Implausiblyfun marked this pull request as ready for review March 26, 2022 23:24
@Implausiblyfun
Copy link
Contributor Author

Ah nice I guess I didnt dig deep enough on it.
This now definitely feels worth it. Shall we merge this into the events branch?

@200sc 200sc self-requested a review March 26, 2022 23:25
@200sc 200sc merged commit 7f35da3 into feature/v4-events Mar 28, 2022
@200sc 200sc deleted the poc/v4-eventhandler-rename branch March 29, 2022 00:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants