21 Log::Error(
"GameData: {} was not read: {}", path,
file.error().Detail);
25 _file = std::make_unique<GameDataDocument>(std::move(*
file));
28 _scanner = std::make_unique<GameDataScanner>(*_file, _originalOf, _scriptOf);
29 _scanner->ResolveAll();
30 _scanner->LogSummary(path);
32 const std::vector<std::string>&
failures = _scanner->Failures();
47 return NotBound(
"not in gamedata");
49 if (!
entry->Reason.empty())
51 return NotBound(
entry->Reason);
55 return NotBound(std::format(
"in '{}', which this member does not bind from",
entry->Sections[0]));
58 return {.Found =
true, .Address =
entry->Address, .Value =
entry->Value};
63 _reason = std::move(
reason);
64 return {.Reason = _reason};
GameDataLocation Lookup(GameDataSection sections, std::string_view key) override
GameDataTable(std::string_view path, const OriginalSlotLookup &originalOf={}, const ScriptBindingLookup &scriptOf={})
static Result< T > ReadFile(std::string_view path)
Parse path (resolved via ResolvePath) into T.
static std::string Join(const std::vector< std::string > &parts, std::string_view delimiter)
void Error(std::format_string< Args... > fmt, Args &&... args)
void WriteGameDataRecord(const GameDataRecord &resolved)
std::function< Result< ScriptTarget >(void *classTable, std::string_view name)> ScriptBindingLookup
static std::string ReadFile(const std::filesystem::path &path)
std::function< const void *(void **vtable, int index)> OriginalSlotLookup