3#include <initializer_list>
8#include <unordered_map>
11#include <BufferStream.h>
92 explicit FGD(
const std::filesystem::path& fgdPath);
99 void load(
const std::filesystem::path& fgdPath);
103 [[nodiscard]] sourcepp::math::Vec2i
getMapSize()
const;
105 [[nodiscard]]
const std::unordered_map<std::string_view, Entity>&
getEntities()
const;
112 void readEntities(BufferStreamReadOnly& stream,
const std::filesystem::path& path, std::vector<std::filesystem::path>& seenPaths);
118 std::unordered_map<std::string_view, Entity>
entities;
157 KeyValueFlagsWriter&
flag(uint64_t value, std::string_view displayName,
bool enabledByDefault, std::string_view description =
"");
167 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);
169 KeyValueChoicesWriter beginKeyValueChoices(std::string_view name, std::string_view displayName =
"", std::string_view valueDefault =
"", std::string_view description =
"",
bool readOnly =
false,
bool report =
false);
173 EntityWriter&
input(std::string_view name, std::string_view valueType, std::string_view description =
"");
175 EntityWriter&
output(std::string_view name, std::string_view valueType, std::string_view description =
"");
197 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 =
"");
199 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 =
"");
201 [[nodiscard]] std::string
bake()
const;
203 bool bake(
const std::filesystem::path& fgdPath)
const;