ppb / pursuedpybear

A python game engine.
https://ppb.dev/
Artistic License 2.0
259 stars 98 forks source link

System Lookup Interface #97

Open pathunstrom opened 5 years ago

pathunstrom commented 5 years ago

Right now, when one system needed another system, there's no good way to do it.

As part of this issue, we should build an interface to allow this.

Considerations:

AstraLuma commented 5 years ago

These are the kind of operations that don't require IO, or the IO required is synchronous, so making this API async (with callbacks or coroutines) would have little value without future plans to make more of the system async.

This also comes up in other ways:

AstraLuma commented 5 years ago

An idea that's been floating around is registering systems (or API proxies) onto events, making them accessible to all event handlers.

While this technique hasn't been used yet, it's an option to implement this?

pathunstrom commented 4 years ago

This has come back up with discussion of dependency injection needs. Still needed, design still isn't finished.

AstraLuma commented 3 months ago

I think we call this "dependency injection".