27 public function __construct(
32 private int $currentTransitionTicks,
33 private int $totalTransitionTicks,
34 private string $easeType
37 public function getName() :
string{
return $this->name; }
39 public function getFromAttribute() : ?
AttributeValue{
return $this->fromAttribute; }
41 public function getAttribute() :
AttributeValue{
return $this->attribute; }
43 public function getToAttribute() : ?
AttributeValue{
return $this->toAttribute; }
45 public function getCurrentTransitionTicks() :
int{
return $this->currentTransitionTicks; }
47 public function getTotalTransitionTicks() :
int{
return $this->totalTransitionTicks; }
52 public function getEaseType() : string{ return $this->easeType; }
54 public static function read(ByteBufferReader $in) : self{
56 $fromAttribute = CommonTypes::getBool($in) ? AttributeValue::read($in) : null;
57 $attribute = AttributeValue::read($in);
58 $toAttribute = CommonTypes::getBool($in) ? AttributeValue::read($in) : null;
59 $currentTransitionTicks = LE::readUnsignedInt($in);
60 $totalTransitionTicks = LE::readUnsignedInt($in);
61 $easeType = CommonTypes::getString($in);
68 $currentTransitionTicks,
69 $totalTransitionTicks,
74 public function write(ByteBufferWriter $out) : void{
76 CommonTypes::writeOptional($out, $this->fromAttribute, fn(ByteBufferWriter $out, AttributeValue $value) => $value->write($out));
77 $this->attribute->write($out);
78 CommonTypes::writeOptional($out, $this->toAttribute, fn(ByteBufferWriter $out, AttributeValue $value) => $value->write($out));
79 LE::writeUnsignedInt($out, $this->currentTransitionTicks);
80 LE::writeUnsignedInt($out, $this->totalTransitionTicks);
81 CommonTypes::putString($out, $this->easeType);