aboutsummaryrefslogtreecommitdiff
path: root/source/Level.hpp
diff options
context:
space:
mode:
authorrtk0c <[email protected]>2022-05-30 17:03:20 -0700
committerrtk0c <[email protected]>2022-05-30 17:03:20 -0700
commite66286ebe30afc9acc4531fc2bea29b7fb924f93 (patch)
treefa6b76554c3eb88bc8f088fbab68e20c40118ca7 /source/Level.hpp
parent366ef5a5450c6e0e680c924c3454943a9ae9814d (diff)
Changeset: 56 Buildsystem cleanup: change to layered structure for different targets
Diffstat (limited to 'source/Level.hpp')
-rw-r--r--source/Level.hpp71
1 files changed, 0 insertions, 71 deletions
diff --git a/source/Level.hpp b/source/Level.hpp
deleted file mode 100644
index c1170a3..0000000
--- a/source/Level.hpp
+++ /dev/null
@@ -1,71 +0,0 @@
-#pragma once
-
-#include "GameObject.hpp"
-#include "RcPtr.hpp"
-#include "Uid.hpp"
-
-#include <robin_hood.h>
-#include <filesystem>
-#include <vector>
-
-// Forward declarations
-class Level;
-class LevelManager;
-
-/// Represents a seralized GameObject tree.
-class Level : public RefCounted {
- friend class LevelManager;
-
-private:
- struct InstanciationEntry;
-
- LevelManager* mMan;
- std::vector<InstanciationEntry> mEntries;
-
-public:
- Level();
- ~Level();
-
- void Instanciate(GameObject* relRoot) const;
-};
-
-class LevelManager {
-public:
- static inline LevelManager* instance = nullptr;
-
-public: // NOTE: public for the editor; actual game components should not modify the map using this
- struct LoadableObject {
- RcPtr<Level> level; // TODO make weak pointer
- std::filesystem::path filePath;
- // NOTE: these fields are only loaded in dev mode
- std::string name;
- std::string description;
- };
- // We want pointer stability here for the editor (inspector object)
- robin_hood::unordered_node_map<Uid, LoadableObject> mObjByUid;
-
-public:
- void DiscoverFilesDesignatedLocation();
- void DiscoverFiles(const std::filesystem::path& dir);
-
- Level* FindLevel(const Uid& uid) const;
- /// Get or load the given level
- Level* LoadLevel(const Uid& uid);
- /// Send the given level to be loaded on another thread
- void PrepareLevel(const Uid& uid);
-
- // These should only be used by the editor
- LoadableObject& AddLevel(const Uid& uid);
-};
-
-class LevelWrapperObject : public GameObject {
-private:
- RcPtr<Level> mLevel;
-
-public:
- LevelWrapperObject(GameWorld* world);
- ~LevelWrapperObject() override;
-
- Level* GetBoundLevel() const;
- void SetBoundLevel(Level* level);
-};