EntityPlus icon indicating copy to clipboard operation
EntityPlus copied to clipboard

Customization point

Open Yelnats321 opened this issue 8 years ago • 1 comments

Had an idea for a while to specify the underlying storage of a component (for example an unordered_map may be more performant for some data sets). This would be done by supplying a component_list with an unordered<T> as a template argument, which seems like a very clean way of doing it, but might be hard to implement.

On a similar vein, add a not option for get_entities and for_each, so one can ask for specific tags/components and also specify which tags/components not to have. So something like for_each<Position, Player, not<Inactive>> would fetch every player+position that does not have the Inactive tag. Not restricted to tags, could be components too.

Yelnats321 avatar Mar 09 '17 17:03 Yelnats321

Customization points are currently on hold until I gather a good way of customizing the containers. There is a lot to consider (custom containers? allocators? how about in-place construction of those?).

If you really care about customizing the containers used please comment, and to what extend you want customization.

The three places customization makes sense is:

  1. How components are stored
  2. How groupings are stored/allocated (don't forget there is an internal grouping with all entities in it)
  3. What get_entities should return

Again, it's a hard problem filled with various challenges that I won't tackle unless someone actually wants to use custom allocators/containers and can make an argument why it's useful.

Yelnats321 avatar Nov 28 '17 22:11 Yelnats321