Class endstone::GameRuleId¶
ClassList > endstone > GameRuleId
Represents the identifier of a game rule, carrying the type of the rule's value.
#include <endstone/game_rule.h>
Inherits the following classes: endstone::Identifier
Public Static Attributes inherited from endstone::Identifier¶
| Type | Name |
|---|---|
| constexpr std::string_view | Minecraft = "minecraft"The namespace representing all inbuilt keys. |
Public Functions¶
| Type | Name |
|---|---|
| constexpr | Identifier (const char * s) noexcept Constructs an identifier by parsing a string. |
| constexpr | Identifier (const std::string & s) noexcept Constructs an identifier by parsing a string. |
| constexpr | Identifier (const std::string_view & identifier) noexcept Constructs an identifier by parsing a string. |
| constexpr | Identifier (const std::string_view & namespace_, const std::string_view & key) noexcept Constructs an identifier from a separate namespace and key. |
Public Functions inherited from endstone::Identifier¶
| Type | Name |
|---|---|
| constexpr | Identifier (const char * s) noexcept Constructs an identifier by parsing a string. |
| constexpr | Identifier (const std::string & s) noexcept Constructs an identifier by parsing a string. |
| constexpr | Identifier (const std::string_view & identifier) noexcept Constructs an identifier by parsing a string. |
| constexpr | Identifier (const std::string_view & namespace_, const std::string_view & key) noexcept Constructs an identifier from a separate namespace and key. |
| constexpr std::string_view | getKey () noexcept const Gets the key component of this identifier. |
| constexpr std::string_view | getNamespace () noexcept const Gets the namespace component of this identifier. |
| string () const |
|
| constexpr bool | operator!= (const Identifier & other) noexcept const |
| constexpr bool | operator== (const Identifier & other) noexcept const |
Public Static Functions¶
| Type | Name |
|---|---|
| constexpr GameRuleId | minecraft (const std::string_view key) noexcept |
Public Static Functions inherited from endstone::Identifier¶
| Type | Name |
|---|---|
| constexpr Identifier | minecraft (const std::string_view key) noexcept Creates an identifier in the minecraft namespace with the given key. |
Public Functions Documentation¶
function Identifier [¼]¶
Constructs an identifier by parsing a string.
See the string_view overload for the parsing rules.
Parameters:
sThe identifier string.
function Identifier [2/4]¶
Constructs an identifier by parsing a string.
See the string_view overload for the parsing rules.
Parameters:
sThe identifier string.
function Identifier [¾]¶
Constructs an identifier by parsing a string.
If the string contains a colon, the part before the last colon is taken as the namespace and the remainder as the key. Otherwise the whole string is the key and the namespace defaults to minecraft.
Parameters:
identifierThe identifier string.
function Identifier [4/4]¶
Constructs an identifier from a separate namespace and key.
inline constexpr endstone::GameRuleId::Identifier (
const std::string_view & namespace_,
const std::string_view & key
) noexcept
Parameters:
namespace_The namespace component.keyThe key component.
Public Static Functions Documentation¶
function minecraft¶
static inline constexpr GameRuleId endstone::GameRuleId::minecraft (
const std::string_view key
) noexcept
The documentation for this class was generated from the following file include/endstone/game_rule.h