dao::gda
The game’s data tables (2DA/GDA): read a value by table, row and column.
Declared in dao/Gda.h.
Functions
Columns()
std::optional<std::int32_t> Columns(script::Table table)
Returns the number of columns in a table, or nullopt if the game has no such table.
Columns()
std::optional<std::int32_t> Columns(std::int32_t table)
Returns the number of columns in a table.
Returns nullopt if the game has no such table
GetBool()
std::optional<bool> GetBool(script::Table table, std::int32_t row, std::string_view column)
Reads a bool cell by the column’s name.
GetBool()
std::optional<bool> GetBool(std::int32_t table, std::int32_t row, std::uint32_t columnHash)
Reads a bool cell.
Works like GetInt. For a column of another type it returns the table’s own conversion of the value.
GetFloat()
std::optional<float> GetFloat(script::Table table, std::int32_t row, std::string_view column)
Reads a float cell by the column’s name.
GetFloat()
std::optional<float> GetFloat(std::int32_t table, std::int32_t row, std::uint32_t columnHash)
Reads a float cell. Works like GetInt.
GetInt()
std::optional<std::int32_t> GetInt(script::Table table, std::int32_t row, std::string_view column)
Reads an int cell by the column’s name. Otherwise it works like GetInt above.
GetInt()
std::optional<std::int32_t> GetInt(std::int32_t table, std::int32_t row, std::uint32_t columnHash)
Reads an int cell of a data table.
| Parameter | |
|---|---|
table |
one of the scripts’ TABLE_* numbers (dao::script::Table) |
row |
the row’s ID, as scripts pass it to GetM2DAInt |
columnHash |
the column’s name, hashed with core::GdaColumnHash |
Returns nullopt if the game has no such table, row or column, or has not loaded its tables yet
GetString()
std::optional<std::wstring> GetString(script::Table table, std::int32_t row, std::string_view column)
Reads a string cell by the column’s name.
GetString()
std::optional<std::wstring> GetString(std::int32_t table, std::int32_t row, std::uint32_t columnHash)
Reads a string cell.
Works like GetInt. For a column of another type it returns the table’s own conversion of the value, as GetM2DAString does.
Rows()
std::optional<std::int32_t> Rows(script::Table table)
Returns the number of rows in a table, or nullopt if the game has no such table.
Rows()
std::optional<std::int32_t> Rows(std::int32_t table)
Returns the number of rows in a table.
Returns nullopt if the game has no such table