dao::Field
struct
A field of type T, reached from an object through a path of Depth offsets.
Declared in dao/Field.h.
Functions
Get()
T Get(const void *object) const
Reads the field with plain loads, the way the engine’s own code does, and does not check the pointers it follows.
Use it on an object the engine has just handed you. A bad object crashes the game.
TryGet()
std::optional<T> TryGet(const void *object) const
Reads the field with every load guarded (dao/SafeRead.h), so a bad pointer returns nullopt instead of crashing.
Use it off the game thread, or on an object you are not sure of.
Returns the value, or nullopt if a plain read would have faulted
Fields
| Field | Type | |
|---|---|---|
path |
core::FieldPath<T, Depth> |
the offsets; each one but the last leads to a pointer |