Efficient way of matching entities to systems in an entity component system

后端 未结 6 541
再見小時候
再見小時候 2021-01-31 04:53

I\'m working on a data-oriented entity component system where component types and system signatures are known at compile-time.


An entity

6条回答
  •  猫巷女王i
    2021-01-31 05:17

    Have you considered the following solution? Each signature will have a container of entities that match that signature.

    When a component is added or removed you need to update the relevant signature container.

    Now the function can simply go to the signature entity container and execute the function for each entity.

提交回复
热议问题