aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/api/ParticleEmitter.cpp
diff options
context:
space:
mode:
authorLoek Le Blansch <loek@pipeframe.xyz>2024-12-12 22:45:12 +0100
committerLoek Le Blansch <loek@pipeframe.xyz>2024-12-12 22:45:12 +0100
commit23196be83778973d9688cc5d465e4e4a16476568 (patch)
tree91dee3b2c2e05d3b529cf537d12a7faf7ec21dc1 /src/crepe/api/ParticleEmitter.cpp
parent297d621987c224db26eadfb9bde9235741387496 (diff)
add documentation
Diffstat (limited to 'src/crepe/api/ParticleEmitter.cpp')
-rw-r--r--src/crepe/api/ParticleEmitter.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/crepe/api/ParticleEmitter.cpp b/src/crepe/api/ParticleEmitter.cpp
index 90b77a0..fd69e26 100644
--- a/src/crepe/api/ParticleEmitter.cpp
+++ b/src/crepe/api/ParticleEmitter.cpp
@@ -1,6 +1,7 @@
#include "ParticleEmitter.h"
using namespace crepe;
+using namespace std;
ParticleEmitter::ParticleEmitter(game_object_id_t game_object_id, const Data & data)
: Component(game_object_id),
@@ -9,3 +10,17 @@ ParticleEmitter::ParticleEmitter(game_object_id_t game_object_id, const Data & d
this->data.particles.emplace_back();
}
}
+
+unique_ptr<Component> ParticleEmitter::save() const {
+ return unique_ptr<Component>{new ParticleEmitter(*this)};
+}
+
+void ParticleEmitter::restore(const Component & snapshot) {
+ *this = static_cast<const ParticleEmitter &>(snapshot);
+}
+
+ParticleEmitter & ParticleEmitter::operator=(const ParticleEmitter & other) {
+ data.particles = other.data.particles;
+ return *this;
+}
+