Skip to content
Modar Nasser edited this page Jun 18, 2024 · 3 revisions

In file LDtkLoader/Field.hpp

Struct : ldtk::Field<T>

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.

Methods

is_null

constexpr ldtk::Field::is_null() const -> bool

Returns true if the Field is optional and does not hold a value, returns false otherwise.

value

constexpr value() const -> const T&

Returns the value of the field.

value_or

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.

🔝

Struct : ldtk::ArrayField<T>

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.

Clone this wiki locally