PocketMine-MP 5.21.2 git-b2aa6396c3cc2cafdd815eacc360e1ad89599899
Loading...
Searching...
No Matches
pocketmine\data\runtime\RuntimeEnumMetadata Class Reference
+ Collaboration diagram for pocketmine\data\runtime\RuntimeEnumMetadata:

Public Member Functions

 __construct (array $members)
 
 enumToInt (object $enum)
 
 intToEnum (int $value)
 

Static Public Member Functions

static from (\UnitEnum $case)
 

Public Attributes

readonly int $bits
 

Detailed Description

A big hack to allow lazily associating enum cases with packed bit values for RuntimeDataDescriber :)

Definition at line 39 of file RuntimeEnumMetadata.php.

Constructor & Destructor Documentation

◆ __construct()

pocketmine\data\runtime\RuntimeEnumMetadata::__construct ( array $members)
Parameters
\UnitEnum[]$members@phpstan-param list<T> $members

Definition at line 57 of file RuntimeEnumMetadata.php.

References pocketmine\data\runtime\RuntimeEnumMetadata\enumToInt(), and pocketmine\data\runtime\RuntimeEnumMetadata\intToEnum().

+ Here is the call graph for this function:

Member Function Documentation

◆ enumToInt()

pocketmine\data\runtime\RuntimeEnumMetadata::enumToInt ( object $enum)

@phpstan-param T $enum

Definition at line 83 of file RuntimeEnumMetadata.php.

Referenced by pocketmine\data\runtime\RuntimeEnumMetadata\__construct().

+ Here is the caller graph for this function:

◆ from()

static pocketmine\data\runtime\RuntimeEnumMetadata::from ( \UnitEnum $case)
static

@phpstan-template TEnum of \UnitEnum @phpstan-param TEnum $case

@phpstan-return self<TEnum>

Definition at line 99 of file RuntimeEnumMetadata.php.

◆ intToEnum()

pocketmine\data\runtime\RuntimeEnumMetadata::intToEnum ( int $value)

@phpstan-return T|null

Definition at line 76 of file RuntimeEnumMetadata.php.

Referenced by pocketmine\data\runtime\RuntimeEnumMetadata\__construct().

+ Here is the caller graph for this function:

Member Data Documentation

◆ $bits

readonly int pocketmine\data\runtime\RuntimeEnumMetadata::$bits

Definition at line 40 of file RuntimeEnumMetadata.php.


The documentation for this class was generated from the following file: