CSEngine
Loading...
Searching...
No Matches
SSceneLoader.h
1//
2// Created by ounols on 19. 4. 28.
3//
4
5#pragma once
6
7#include <string>
8#include "../../../Object/SScene.h"
9#include "../XML/XML.h"
10
11namespace CSE {
12
14 private:
15 struct NodeKey {
16 XNode node;
17 std::string id;
18 std::string hash;
19 SGameObject* obj;
20 };
21
22 struct ComponentValue {
23 XNode node;
24 std::string id;
25 SComponent* comp;
26 };
27 public:
29
31
32 static SScene* LoadScene(const std::string& path);
33
34 static bool SaveScene(SScene* scene, std::string path);
35
36 static bool SavePrefab(SGameObject* root, std::string path);
37
38 private:
39 static void ExploringScene(const XNode& node, std::vector<NodeKey*>& objs, std::vector<ComponentValue*>& comps);
40
41 static void LinkingID(std::vector<NodeKey*>& objs, SGameObject* root);
42
43 static void LinkingReference(std::vector<ComponentValue*>& comps);
44
45 static void ExploringPrefab(const XNode& node, std::vector<NodeKey*>& objs, std::vector<ComponentValue*>& comps,
46 SScene* scene);
47
48 static void LinkingResourceID(const XNode& node, SGameObject* root, std::vector<NodeKey*>& objs,
49 std::vector<ComponentValue*>& comps);
50
51 static std::string GetGameObjectValue(SGameObject* obj, bool ignorePrefab = false);
52
53 static std::string ComparePrefab(SGameObject* obj);
54
55 static std::string PrintGameObject(SGameObject* obj);
56
57 static bool Save(const std::string& buf, const std::string& path);
58 };
59}
Definition XML.h:43