3#include <initializer_list>
9#include <unordered_map>
12#include <BufferStream.h>
21 using std::runtime_error::runtime_error;
98 explicit FGD(
const std::filesystem::path& fgdPath);
105 void load(
const std::filesystem::path& fgdPath);
109 [[nodiscard]] sourcepp::math::Vec2i
getMapSize()
const;
111 [[nodiscard]]
const std::unordered_map<std::string_view, Entity>&
getEntities()
const;
115 [[nodiscard]]
const std::unordered_map<std::string_view, std::string_view>&
getMainKeyValues()
const;
120 void readEntities(BufferStreamReadOnly& stream,
const std::filesystem::path& path, std::vector<std::filesystem::path>& seenPaths);
126 std::unordered_map<std::string_view, Entity>
entities;
166 KeyValueFlagsWriter&
flag(uint64_t value, std::string_view displayName,
bool enabledByDefault, std::string_view description =
"");
176 EntityWriter&
keyValue(std::string_view name, std::string_view valueType, std::string_view displayName =
"", std::string_view valueDefault =
"", std::string_view description =
"",
bool readOnly =
false,
bool report =
false);
178 KeyValueChoicesWriter beginKeyValueChoices(std::string_view name, std::string_view displayName =
"", std::string_view valueDefault =
"", std::string_view description =
"",
bool readOnly =
false,
bool report =
false);
182 EntityWriter&
input(std::string_view name, std::string_view valueType, std::string_view description =
"");
184 EntityWriter&
output(std::string_view name, std::string_view valueType, std::string_view description =
"");
212 EntityWriter beginEntity(std::string_view classType, std::initializer_list<std::string_view> classProperties, std::string_view name, std::string_view description =
"", std::string_view docsURL =
"");
214 EntityWriter beginEntity(std::string_view classType, std::span<const std::string_view> classProperties, std::string_view name, std::string_view description =
"", std::string_view docsURL =
"");
216 [[nodiscard]] std::string
bake()
const;
218 bool bake(
const std::filesystem::path& fgdPath)
const;