aboutsummaryrefslogtreecommitdiff
path: root/source/Game/EditorAttachmentImpl.cpp
blob: b09c133c978080cbef1710e458d575791d336a37 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include "EditorAttachmentImpl.hpp"
#include "EditorAttachment.hpp"

#include <Metadata.hpp>

EditorAttachment::EditorAttachment() {
}

std::unique_ptr<EditorAttachment> EaGameObject::Create(GameObject* object) {
	EaGameObject* result;

	auto kind = object->GetKind();
	switch (kind) {
		case GameObject::KD_Player: result = new EaPlayer(); break;
		case GameObject::KD_LevelWrapper: result = new EaLevelWrapper(); break;

		default: result = new EaGameObject(); break;
	}

	result->name = Metadata::EnumToString(kind);
	result->eulerAnglesRotation = glm::eulerAngles(object->GetRotation());
	return std::unique_ptr<EditorAttachment>(result);
}