24 use GetTypeIdFromConstTrait;
26 public const ID = PrimitiveShapeType::PAYLOAD_TYPE_PYRAMID;
28 public function __construct(
30 private ?
float $depth,
31 private float $height,
34 public function getWidth() :
float{
return $this->width; }
36 public function getDepth() : ?
float{
return $this->depth; }
38 public function getHeight() :
float{
return $this->height; }
40 public static function read(ByteBufferReader $in) :
self{
41 $width = LE::readFloat($in);
42 $depth = CommonTypes::readOptional($in, LE::readFloat(...));
43 $height = LE::readFloat($in);
45 return new self($width, $depth, $height);
48 public function write(ByteBufferWriter $out) :
void{
49 LE::writeFloat($out, $this->width);
50 CommonTypes::writeOptional($out, $this->depth, LE::writeFloat(...));
51 LE::writeFloat($out, $this->height);