alecthomas / entityx

EntityX - A fast, type-safe C++ Entity-Component system
MIT License
2.22k stars 295 forks source link

Enable Entity cloning via EntityManager::create_from_copy #140

Closed zackthehuman closed 8 years ago

zackthehuman commented 8 years ago

This PR enables the ability to create a component-wise clone of an entity. Each component is copy-constructed by using the existing assign_from_copy method.

A test has been added which shows that the component is copied but is unique.

This implements the feature requested in #126.

alecthomas commented 8 years ago

Thanks!