diff options
author | rtk0c <[email protected]> | 2022-06-27 18:27:13 -0700 |
---|---|---|
committer | rtk0c <[email protected]> | 2022-06-27 18:27:13 -0700 |
commit | 8f0dda5eab181b0f14f2652b4e984aaaae3f258c (patch) | |
tree | 4b825dc642cb6eb9a060e54bf8d69288fbee4904 /core/src/Model/Template/Template.hpp | |
parent | fad6a88a13ab1f888ab25ad0aae19c1d63aa0623 (diff) |
Start from a clean slate
Diffstat (limited to 'core/src/Model/Template/Template.hpp')
-rw-r--r-- | core/src/Model/Template/Template.hpp | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/core/src/Model/Template/Template.hpp b/core/src/Model/Template/Template.hpp deleted file mode 100644 index 061cc07..0000000 --- a/core/src/Model/Template/Template.hpp +++ /dev/null @@ -1,68 +0,0 @@ -#pragma once - -#include "Model/Assets.hpp" -#include "cplt_fwd.hpp" - -#include <filesystem> -#include <iosfwd> -#include <memory> -#include <string> - -class Template : public Asset -{ -public: - enum Kind - { - KD_Table, - - InvalidKind, - KindCount = InvalidKind, - }; - - using CategoryType = TemplateAssetList; - -private: - Kind mKind; - -public: - static const char* FormatKind(Kind kind); - static std::unique_ptr<Template> CreateByKind(Kind kind); - - static bool IsInstance(const Template* tmpl); - - Template(Kind kind); - ~Template() override = default; - - Kind GetKind() const; - - virtual void ReadFromDataStream(InputDataStream& stream) = 0; - virtual void WriteToDataStream(OutputDataStream& stream) const = 0; -}; - -class TemplateAssetList final : public AssetListTyped<Template> -{ -private: - // AC = Asset Creator - std::string mACNewName; - NameSelectionError mACNewNameError = NameSelectionError::Empty; - Template::Kind mACNewKind = Template::InvalidKind; - -public: - // Inherit constructors - using AssetListTyped::AssetListTyped; - -protected: - void DiscoverFiles(const std::function<void(SavedAsset)>& callback) const override; - - std::string RetrieveNameFromFile(const std::filesystem::path& file) const override; - uuids::uuid RetrieveUuidFromFile(const std::filesystem::path& file) const override; - std::filesystem::path RetrievePathFromAsset(const SavedAsset& asset) const override; - - bool SaveInstance(const SavedAsset& assetInfo, const Asset* asset) const override; - Template* LoadInstance(const SavedAsset& assetInfo) const override; - Template* CreateInstance(const SavedAsset& assetInfo) const override; - bool RenameInstanceOnDisk(const SavedAsset& assetInfo, std::string_view oldName) const override; - - void DisplayAssetCreator(ListState& state) override; - void DisplayDetailsTable(ListState& state) const override; -}; |