blob: fcfce14b4bc521391b469bc2ad1c1cac7a4bf0d5 (
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);
}
 |