PocketMine-MP 5.42.1 git-d77520d210fcb967a02bc11817ad625393c8ebc6
Loading...
Searching...
No Matches
pocketmine\data\bedrock\block\convert\property\ValueFromStringProperty Class Reference
+ Inheritance diagram for pocketmine\data\bedrock\block\convert\property\ValueFromStringProperty:
+ Collaboration diagram for pocketmine\data\bedrock\block\convert\property\ValueFromStringProperty:

Public Member Functions

 __construct (private string $name, private StateMap $map, private \Closure $getter, private \Closure $setter)
 
 deserialize (object $block, BlockStateReader $in)
 
 deserializePlain (object $block, string $raw)
 
 getName ()
 
 getPossibleValues ()
 
 serialize (object $block, BlockStateWriter $out)
 
 serializePlain (object $block)
 

Detailed Description

@phpstan-template TBlock of object @phpstan-template TValue of int|\UnitEnum @phpstan-implements StringProperty<TBlock>

Definition at line 38 of file ValueFromStringProperty.php.

Constructor & Destructor Documentation

◆ __construct()

pocketmine\data\bedrock\block\convert\property\ValueFromStringProperty::__construct ( private string $name,
private StateMap $map,
private \Closure $getter,
private \Closure $setter )

@phpstan-param StateMap<TValue, string> $map @phpstan-param \Closure(TBlock) : TValue $getter @phpstan-param \Closure(TBlock, TValue) : mixed $setter

Definition at line 45 of file ValueFromStringProperty.php.

Member Function Documentation

◆ deserialize()

pocketmine\data\bedrock\block\convert\property\ValueFromStringProperty::deserialize ( object $block,
BlockStateReader $in )

@phpstan-param TBlock $block

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

Definition at line 63 of file ValueFromStringProperty.php.

◆ deserializePlain()

pocketmine\data\bedrock\block\convert\property\ValueFromStringProperty::deserializePlain ( object $block,
string $raw )

TODO: These are only used for flattened IDs for now, we should expand their use to all properties in the future and remove the dependencies on BlockStateReader and BlockStateWriter @phpstan-param TBlock $block

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

Definition at line 67 of file ValueFromStringProperty.php.

◆ getName()

pocketmine\data\bedrock\block\convert\property\ValueFromStringProperty::getName ( )

◆ getPossibleValues()

pocketmine\data\bedrock\block\convert\property\ValueFromStringProperty::getPossibleValues ( )
Returns
string[] @phpstan-return list<string>

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

Definition at line 58 of file ValueFromStringProperty.php.

◆ serialize()

pocketmine\data\bedrock\block\convert\property\ValueFromStringProperty::serialize ( object $block,
BlockStateWriter $out )

@phpstan-param TBlock $block

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

Definition at line 73 of file ValueFromStringProperty.php.

◆ serializePlain()

pocketmine\data\bedrock\block\convert\property\ValueFromStringProperty::serializePlain ( object $block)

TODO: These are only used for flattened IDs for now, we should expand their use to all properties in the future and remove the dependencies on BlockStateReader and BlockStateWriter @phpstan-param TBlock $block

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

Definition at line 77 of file ValueFromStringProperty.php.


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