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

Public Member Functions

 __construct (private string $name, private string $falseValue, private string $trueValue, 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-implements StringProperty<TBlock>

Definition at line 34 of file BoolFromStringProperty.php.

Constructor & Destructor Documentation

◆ __construct()

pocketmine\data\bedrock\block\convert\property\BoolFromStringProperty::__construct ( private string $name,
private string $falseValue,
private string $trueValue,
private \Closure $getter,
private \Closure $setter )
Parameters

Closure(TBlock) : bool $getter

Parameters

Closure(TBlock, bool) : mixed $setter

Definition at line 40 of file BoolFromStringProperty.php.

Member Function Documentation

◆ deserialize()

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

@phpstan-param TBlock $block

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

Definition at line 56 of file BoolFromStringProperty.php.

◆ deserializePlain()

pocketmine\data\bedrock\block\convert\property\BoolFromStringProperty::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 60 of file BoolFromStringProperty.php.

◆ getName()

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

◆ getPossibleValues()

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

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

Definition at line 52 of file BoolFromStringProperty.php.

◆ serialize()

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

@phpstan-param TBlock $block

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

Definition at line 70 of file BoolFromStringProperty.php.

◆ serializePlain()

pocketmine\data\bedrock\block\convert\property\BoolFromStringProperty::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 74 of file BoolFromStringProperty.php.


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