denniskaselow / dartemis

A Dart port of the Artemis Entity System Framework
BSD 2-Clause "Simplified" License
49 stars 6 forks source link

Rework the way ComponentType works #60

Closed denniskaselow closed 1 week ago

denniskaselow commented 2 years ago

The static fields in ComponentType are a recipe for disaster in testing. When creating a multitude of different components and tests executed later, with fewer different components, use _forComponentsOfEntity in ComponentManager then they will run into out of bounds exceptions when accessing components (as is already happening in coverage where https://github.com/denniskaselow/dartemis/commit/4b8a0299bf3d33e6be7334b905bd236b942ee9a9 doesn't help because of parallel execution of tests).

Maybe make the indexBit-creation/management of the component type part of the world. That should also make if possible to have multiple worlds if that's needed at some point.