22declare(strict_types=1);
24namespace pocketmine\data\runtime;
31 private int $bits = 0;
33 protected function addBits(
int $bits) :
void{
37 public function getBitsUsed() :
int{
41 public function int(
int $bits,
int &$value) :
void{
42 $this->addBits($bits);
46 $this->addBits(((int) log($max - $min, 2)) + 1);
49 public function bool(
bool &$value) : void{
53 public function horizontalFacing(
int &$facing) : void{
58 $this->addBits(count(
Facing::ALL));
62 $this->addBits(count(
Facing::HORIZONTAL));
65 public function facing(
int &$facing) : void{
69 public function facingExcept(
int &$facing,
int $except) : void{
70 $this->facing($facing);
73 public function axis(
int &$axis) : void{
77 public function horizontalAxis(
int &$axis) : void{
85 public function railShape(
int &$railShape) : void{
89 public function straightOnlyRailShape(
int &$railShape) : void{
93 public function enum(\UnitEnum &$case) :
void{
94 $metadata = RuntimeEnumMetadata::from($case);
95 $this->addBits($metadata->bits);
98 public function enumSet(array &$set, array $allCases) : void{
99 $this->addBits(count($allCases));
boundedIntAuto(int $min, int $max, int &$value)
facingFlags(array &$faces)
enumSet(array &$set, array $allCases)
wallConnections(array &$connections)
horizontalFacingFlags(array &$faces)