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

In file LDtkLoader/Enum.hpp

Struct : ldtk::Enum

Fields

name

const std::string ldtk::Enum::name

Name of the Enum.

uid

const int ldtk::Enum::uid

Unique identifier of the Enum.

πŸ”

Methods

operator[]

ldtk::Enum::operator[](const std::string&) const -> const ldtk::EnumValue&

Returns the EnumValue matching the provided name.

If no EnumValue is found, an invalid_argument exception is thrown.

πŸ”

hasIcons

ldtk::Enum::hasIcons() const -> bool

Returns true if the Enum has icons, returns false otherwise.

πŸ”

getIconsTileset

ldtk::Enum::getIconsTileset() const -> const ldtk::Tileset&

Returns the Tileset used by this Enum's icons.

πŸ”

hasTag

Inherited from TagsContainer

ldtk::Enum::hasTag(const std::string&) const -> bool

Returns true if the Enum contains the given tag, returns false otherwise.

πŸ”

allTags

Inherited from TagsContainer

ldtk::Enum::allTags() const -> const std::vector<std::string>&

Returns a vector containing all the tags in the Enum.

πŸ”

Struct : ldtk::EnumValue

Fields

name

const std::string ldtk::EnumValue::name

Name of the EnumValue.

color

const ldtk::Color ldtk::EnumValue::color

Color of the EnumValue.

type

const ldtk::Enum& ldtk::EnumValue::type

Enum object owning this EnumValue.

Allows to access the name of the Enum, for example :

const auto& enum_value = project.getEnum("Items")["SilverSword"];

std::cout << enum_value.type.name;
// output: Items

πŸ”

Methods

hasIcon

ldtk::EnumValue::hasIcon() const -> bool

Returns true if the EnumValue has an icon, returns false otherwise.

getIconTileset

ldtk::EnumValue::getIconTileset() const -> const ldtk::Tileset&

Returns the Tileset of the icon.

getIconTextureRect

ldtk::EnumValue::getIconTextureRect() const -> const ldtk::IntRect&

Returns the texture rectangle of this EnumValue's icon.

πŸ”