leudz / shipyard

Entity Component System focused on usability and flexibility.
Other
755 stars 46 forks source link

How to know all of the components that some entity has? #169

Closed PudgeKim closed 1 year ago

PudgeKim commented 1 year ago

Let's assume a player entitiy has many components. (let's call this entity entityP) If I want to create a new entity which will have same components entityP has, how to do it? and I also want to know all of the component's type the entityP has.

For example,

let new_entity = all_storages.copy(entityP_entity_id);

let all_component = all_storages.get_all_component(entityP_entity_id);
leudz commented 1 year ago

Currently both are impossible.

Experimenting with serialization is on my todo list, I have a few things I want to do before that (tracking rework and workloads improvement).