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;
109 [[nodiscard]]
const std::unordered_map<std::string_view, std::string_view>&
getMainKeyValues()
const;
114 void readEntities(BufferStreamReadOnly& stream,
const std::filesystem::path& path, std::vector<std::filesystem::path>& seenPaths);
120 std::unordered_map<std::string_view, Entity>
entities;
160 KeyValueFlagsWriter&
flag(uint64_t value, std::string_view displayName,
bool enabledByDefault, std::string_view description =
"");
170 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);
172 KeyValueChoicesWriter beginKeyValueChoices(std::string_view name, std::string_view displayName =
"", std::string_view valueDefault =
"", std::string_view description =
"",
bool readOnly =
false,
bool report =
false);
176 EntityWriter&
input(std::string_view name, std::string_view valueType, std::string_view description =
"");
178 EntityWriter&
output(std::string_view name, std::string_view valueType, std::string_view description =
"");
206 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 =
"");
208 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 =
"");
210 [[nodiscard]] std::string
bake()
const;
212 bool bake(
const std::filesystem::path& fgdPath)
const;