aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/api/Transform.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/crepe/api/Transform.cpp')
-rw-r--r--src/crepe/api/Transform.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/crepe/api/Transform.cpp b/src/crepe/api/Transform.cpp
new file mode 100644
index 0000000..fcfce14
--- /dev/null
+++ b/src/crepe/api/Transform.cpp
@@ -0,0 +1,22 @@
+#include "../util/dbg.h"
+
+#include "Transform.h"
+
+using namespace crepe;
+using namespace std;
+
+Transform::Transform(game_object_id_t id, const vec2 & point, double rotation, double scale)
+ : Component(id),
+ position(point),
+ rotation(rotation),
+ scale(scale) {
+ dbg_trace();
+}
+
+unique_ptr<Component> Transform::save() const {
+ return unique_ptr<Component>{new Transform(*this)};
+}
+
+void Transform::restore(const Component & snapshot) {
+ *this = static_cast<const Transform &>(snapshot);
+}