NSSTC / sim-ecs

Batteries included TypeScript ECS
https://nsstc.github.io/sim-ecs/
Mozilla Public License 2.0
84 stars 12 forks source link

implement way to clone entities #21

Closed minecrawler closed 1 year ago

minecrawler commented 3 years ago

I do have some ideas where this is handy. A entity-clone method would need to clone all components, too, though, so we don't accidentally end up with several entities referencing the same component instance.

Hence, the idea is that IEntity exposes a clone() method, which returns a new entity with cloned components.