-
Notifications
You must be signed in to change notification settings - Fork 28
Fields
Modar Nasser edited this page Jun 18, 2024
·
3 revisions
- Structs
A Field holds a value of one of these types: int, float, bool, std::string,
ldtk::Color, ldtk::IntPoint, ldtk::Enum or ldtk::FilePath.
Fields that are optional can be null. They hold the value ldtk::null in that case.
constexpr ldtk::Field::is_null() const -> boolReturns true if the Field is optional and does not hold a value, returns false otherwise.
constexpr value() const -> const T&Returns the value of the field.
constexpr value_or(T&& value) const -> const T&If the Field holds a value, returns it; if the Field is null, returns the value provided as parameter.
ldtk::ArrayField<T> inherits from std::vector<ldtk::Field<T>>, which means it is a vector
that contains ldtk::Field<T> objects. Regular std::vector methods can be used.