aboutsummaryrefslogtreecommitdiff
path: root/src/crepe/api/Transform.cpp
blob: b70174cbabec956208cd365287e3531ff924ac50 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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);
}