25 use GetTypeIdFromConstTrait;
27 public const ID = DynamicValueType::LIST;
45 protected static function readValue(ByteBufferReader $in) : self{
46 $size = VarInt::readUnsignedInt($in);
48 for($i = 0; $i < $size; ++$i){
49 $type = LE::readUnsignedInt($in);
50 $values[] = DynamicValue::read($in, $type);
52 return new self($values);
55 protected function writeValue(ByteBufferWriter $out) : void{
56 VarInt::writeUnsignedInt($out, count($this->values));
57 foreach($this->values as $value){
58 LE::writeUnsignedInt($out, $value?->getTypeId() ?? DynamicValueType::NULL);