/** * {@inheritdoc} */ public function writeTo(\Protobuf\WriteContext $context) { $stream = $context->getStream(); $writer = $context->getWriter(); $sizeContext = $context->getComputeSizeContext(); if ($this->active_pokemon !== null) { $writer->writeVarint($stream, 10); $writer->writeVarint($stream, $this->active_pokemon->serializedSize($sizeContext)); $this->active_pokemon->writeTo($context); } if ($this->trainer_public_profile !== null) { $writer->writeVarint($stream, 18); $writer->writeVarint($stream, $this->trainer_public_profile->serializedSize($sizeContext)); $this->trainer_public_profile->writeTo($context); } if ($this->reverse_pokemon !== null) { foreach ($this->reverse_pokemon as $val) { $writer->writeVarint($stream, 26); $writer->writeVarint($stream, $val->serializedSize($sizeContext)); $val->writeTo($context); } } if ($this->defeated_pokemon !== null) { foreach ($this->defeated_pokemon as $val) { $writer->writeVarint($stream, 34); $writer->writeVarint($stream, $val->serializedSize($sizeContext)); $val->writeTo($context); } } if ($this->extensions !== null) { $this->extensions->writeTo($context); } return $stream; }
/** * {@inheritdoc} */ public function writeTo(\Protobuf\WriteContext $context) { $stream = $context->getStream(); $writer = $context->getWriter(); $sizeContext = $context->getComputeSizeContext(); if ($this->pokemon_data !== null) { $writer->writeVarint($stream, 10); $writer->writeVarint($stream, $this->pokemon_data->serializedSize($sizeContext)); $this->pokemon_data->writeTo($context); } if ($this->trainer_public_profile !== null) { $writer->writeVarint($stream, 18); $writer->writeVarint($stream, $this->trainer_public_profile->serializedSize($sizeContext)); $this->trainer_public_profile->writeTo($context); } if ($this->training_pokemon !== null) { $writer->writeVarint($stream, 26); $writer->writeVarint($stream, $this->training_pokemon->serializedSize($sizeContext)); $this->training_pokemon->writeTo($context); } if ($this->extensions !== null) { $this->extensions->writeTo($context); } return $stream; }