jonascarpay / apecs

a fast, extensible, type driven Haskell ECS framework for games
391 stars 43 forks source link

Add ComponentCounter to Apecs.Experimental.Reactive #121

Closed jship closed 10 months ago

jship commented 10 months ago

Adds a reactive ComponentCounter to track current and max counts of entities with the particular Component assigned.

The PR also includes some minor, unrelated updates to the Apecs.Experimental.Reactive (haddocks and exporting the Printer type).

I'm not sure if there's a protocol for what makes it into the experimental modules, so I defaulted to putting the PR up just to have some code to look at. Let me know if there's a preference on discussing in an issue first.

jonascarpay commented 10 months ago

Thanks, LGTM!

I'm not sure if there's a protocol for what makes it into the experimental modules, so I defaulted to putting the PR up just to have some code to look at. Let me know if there's a preference on discussing in an issue first.

There's no protocol. The experimental modules are just things that I thought made good showcases of how to extend apecs, but at the time wasn't sure yet if they'd actually be worth maintaining. In that spirit, I think this fits right in. Now that apecs is pretty much just mature/stable it might be time to think about restructuring a little.