Block: specifying required type/state data bits is no longer required

RuntimeDataSizeCalculator allows calculating the number of required bits from describeType directly, which considerably reduces boilerplate code.
This commit is contained in:
Dylan K. Taylor
2023-02-16 16:45:19 +00:00
parent c2f6d8139a
commit 55a48e0c84
83 changed files with 242 additions and 172 deletions

View File

@ -48,8 +48,6 @@ abstract class Liquid extends Transparent{
protected int $decay = 0; //PC "level" property
protected bool $still = false;
public function getRequiredStateDataBits() : int{ return 5; }
protected function describeState(RuntimeDataDescriber $w) : void{
$w->boundedInt(3, 0, self::MAX_DECAY, $this->decay);
$w->bool($this->falling);