diff options
Diffstat (limited to 'src/crepe/Component.cpp')
-rw-r--r-- | src/crepe/Component.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/crepe/Component.cpp b/src/crepe/Component.cpp index acfd35c..1aed507 100644 --- a/src/crepe/Component.cpp +++ b/src/crepe/Component.cpp @@ -1,5 +1,20 @@ #include "Component.h" using namespace crepe; +using namespace std; Component::Component(game_object_id_t id) : game_object_id(id) {} + +Component & Component::operator=(const Component & other) { + this->active = other.active; + return *this; +} + +unique_ptr<Component> Component::save() const { + return unique_ptr<Component>(new Component(*this)); +} + +void Component::restore(const Component & snapshot) { + *this = snapshot; +} + |