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

Use lambdas instead of references to managers (refactoring) #33

Open
the-argus opened this issue Mar 17, 2022 · 0 comments
Open

Use lambdas instead of references to managers (refactoring) #33

the-argus opened this issue Mar 17, 2022 · 0 comments

Comments

@the-argus
Copy link
Collaborator

Currently, in order to create things in the game, we pass a reference to the manager for the target object, and then use some function like Manager.CreateObject(args). Instead, pass in an anonymous function that is a passthrough for CreateObject.

Example of old/bad format: passing in a reference to the bulletManager to a new EnemyManager, just so we can call bulletManager.FireBatch. Just pass in a lambda to FireBatch instead.

Example of new/good format: The player is instantiated with an action delegate which it then uses to create bullets.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants