diff options
Diffstat (limited to 'src/crepe/Component.h')
-rw-r--r-- | src/crepe/Component.h | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/crepe/Component.h b/src/crepe/Component.h index eff5a58..fc0268c 100644 --- a/src/crepe/Component.h +++ b/src/crepe/Component.h @@ -1,5 +1,7 @@ #pragma once +#include <memory> + #include "types.h" namespace crepe { @@ -32,11 +34,16 @@ protected: //! Only ComponentManager can create components friend class ComponentManager; - Component(const Component &) = delete; + // components are never moved Component(Component &&) = delete; - virtual Component & operator=(const Component &) = delete; virtual Component & operator=(Component &&) = delete; +protected: + virtual std::unique_ptr<Component> save() const; + Component(const Component &) = default; + virtual void restore(const Component & snapshot); + virtual Component & operator=(const Component &); + public: virtual ~Component() = default; |