PocketMine-MP 5.39.3 git-400eb2dddf91a9c112aa09f3b498ffc8c85e98ed
Loading...
Searching...
No Matches
pocketmine\data\bedrock\block\convert\property\IntFromRawStateMap Class Reference
+ Inheritance diagram for pocketmine\data\bedrock\block\convert\property\IntFromRawStateMap:
+ Collaboration diagram for pocketmine\data\bedrock\block\convert\property\IntFromRawStateMap:

Public Member Functions

 __construct (private array $serializeMap, array $deserializeAliases=[])
 
 getRawToValueMap ()
 
 printableValue (mixed $value)
 
 rawToValue (int|string $raw)
 
 valueToRaw (mixed $value)
 

Static Public Member Functions

static int (array $serializeMap, array $deserializeAliases=[])
 
static string (array $serializeMap, array $deserializeAliases=[])
 

Detailed Description

@phpstan-template TRaw of int|string @phpstan-implements StateMap<int, TRaw>

Definition at line 33 of file IntFromRawStateMap.php.

Constructor & Destructor Documentation

◆ __construct()

pocketmine\data\bedrock\block\convert\property\IntFromRawStateMap::__construct ( private array $serializeMap,
array $deserializeAliases = [] )

Constructs a bidirectional mapping, given a mapping of internal values -> serialized values, and an optional set of aliases per internal value (used for deserializing invalid serialized values).

Parameters
(int|string)[]$serializeMap
(int|int[])|(string|string[])$deserializeAliases

@phpstan-param array<int, TRaw> $serializeMap @phpstan-param array<int, TRaw|list<TRaw>> $deserializeAliases

Definition at line 51 of file IntFromRawStateMap.php.

Member Function Documentation

◆ getRawToValueMap()

pocketmine\data\bedrock\block\convert\property\IntFromRawStateMap::getRawToValueMap ( )

@phpstan-return array<TRaw, TValue>

Implements pocketmine\data\bedrock\block\convert\property\StateMap.

Definition at line 89 of file IntFromRawStateMap.php.

◆ int()

static pocketmine\data\bedrock\block\convert\property\IntFromRawStateMap::int ( array $serializeMap,
array $deserializeAliases = [] )
static
Parameters
int[]$serializeMap
(int|int[])$deserializeAliases

@phpstan-param array<int, int> $serializeMap @phpstan-param array<int, int|list<int>> $deserializeAliases

@phpstan-return self<int>

@phpstan-var array<TRaw, int>

Definition at line 76 of file IntFromRawStateMap.php.

◆ printableValue()

pocketmine\data\bedrock\block\convert\property\IntFromRawStateMap::printableValue ( mixed $value)

@phpstan-param TValue $value

Implements pocketmine\data\bedrock\block\convert\property\StateMap.

Definition at line 101 of file IntFromRawStateMap.php.

◆ rawToValue()

pocketmine\data\bedrock\block\convert\property\IntFromRawStateMap::rawToValue ( int|string $raw)

@phpstan-param TRaw $raw @phpstan-return TValue|null

Implements pocketmine\data\bedrock\block\convert\property\StateMap.

Definition at line 97 of file IntFromRawStateMap.php.

◆ string()

static pocketmine\data\bedrock\block\convert\property\IntFromRawStateMap::string ( array $serializeMap,
array $deserializeAliases = [] )
static
Parameters
string[]$serializeMap
(string|string[])$deserializeAliases

@phpstan-param array<int, string> $serializeMap @phpstan-param array<int, string|list<string>> $deserializeAliases

@phpstan-return self<string>

Definition at line 87 of file IntFromRawStateMap.php.

◆ valueToRaw()

pocketmine\data\bedrock\block\convert\property\IntFromRawStateMap::valueToRaw ( mixed $value)

@phpstan-param TValue $value @phpstan-return TRaw

Implements pocketmine\data\bedrock\block\convert\property\StateMap.

Definition at line 93 of file IntFromRawStateMap.php.


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