Grindstone Game Engine v0.2.0
An open source game engine and toolkit.
Loading...
Searching...
No Matches
ImporterSettings.hpp
1#pragma once
2
3#include <string>
4#include <string_view>
5#include <unordered_map>
6
7namespace Grindstone::Editor {
9 enum class Type : uint8_t {
10 Unknown = 0,
11 String,
12 Uint64,
13 Double,
14 Bool
15 };
16
17 struct Value {
18 Grindstone::Editor::ImporterSettings::Type type;
19 std::string value;
20 };
21
22 using ValueMap = std::unordered_map<std::string, Value>;
23 ValueMap values;
24
25 void SetUnknown(const std::string& key, const std::string& value);
26
27 const std::string& Get(const std::string& key, const std::string& defaultValue);
28 void Set(const std::string& key, const std::string& value);
29
30 uint64_t Get(const std::string& key, uint64_t defaultValue);
31 void Set(const std::string& key, uint64_t value);
32
33 double Get(const std::string& key, double defaultValue);
34 void Set(const std::string& key, double value);
35
36 bool Get(const std::string& key, bool defaultValue);
37 void Set(const std::string& key, bool value);
38
39 using Iterator = ValueMap::iterator;
40 using ConstIterator = ValueMap::const_iterator;
41
42 Iterator begin() noexcept;
43 ConstIterator begin() const noexcept;
44
45 Iterator end() noexcept;
46 ConstIterator end() const noexcept;
47
48 bool isDirty = false;
49 };
50}
Definition ImporterSettings.hpp:17
Definition ImporterSettings.hpp:8