/** * {@inheritdoc} */ public function readFrom(\Protobuf\ReadContext $context) { $reader = $context->getReader(); $length = $context->getLength(); $stream = $context->getStream(); $limit = $length !== null ? $stream->tell() + $length : null; while ($limit === null || $stream->tell() < $limit) { if ($stream->eof()) { break; } $key = $reader->readVarint($stream); $wire = \Protobuf\WireFormat::getTagWireType($key); $tag = \Protobuf\WireFormat::getTagFieldNumber($key); if ($stream->eof()) { break; } if ($tag === 1) { \Protobuf\WireFormat::assertWireType($wire, 14); $this->pokemon_id = \POGOProtos\Enums\PokemonId::valueOf($reader->readVarint($stream)); continue; } if ($tag === 3) { \Protobuf\WireFormat::assertWireType($wire, 2); $this->model_scale = $reader->readFloat($stream); continue; } if ($tag === 4) { \Protobuf\WireFormat::assertWireType($wire, 14); $this->type = \POGOProtos\Enums\PokemonType::valueOf($reader->readVarint($stream)); continue; } if ($tag === 5) { \Protobuf\WireFormat::assertWireType($wire, 14); $this->type_2 = \POGOProtos\Enums\PokemonType::valueOf($reader->readVarint($stream)); continue; } if ($tag === 6) { \Protobuf\WireFormat::assertWireType($wire, 11); $innerSize = $reader->readVarint($stream); $innerMessage = new \POGOProtos\Settings\Master\Pokemon\CameraAttributes(); $this->camera = $innerMessage; $context->setLength($innerSize); $innerMessage->readFrom($context); $context->setLength($length); continue; } if ($tag === 7) { \Protobuf\WireFormat::assertWireType($wire, 11); $innerSize = $reader->readVarint($stream); $innerMessage = new \POGOProtos\Settings\Master\Pokemon\EncounterAttributes(); $this->encounter = $innerMessage; $context->setLength($innerSize); $innerMessage->readFrom($context); $context->setLength($length); continue; } if ($tag === 8) { \Protobuf\WireFormat::assertWireType($wire, 11); $innerSize = $reader->readVarint($stream); $innerMessage = new \POGOProtos\Settings\Master\Pokemon\StatsAttributes(); $this->stats = $innerMessage; $context->setLength($innerSize); $innerMessage->readFrom($context); $context->setLength($length); continue; } if ($tag === 9) { $innerSize = $reader->readVarint($stream); $innerLimit = $stream->tell() + $innerSize; if ($this->quick_moves === null) { $this->quick_moves = new \Protobuf\EnumCollection(); } while ($stream->tell() < $innerLimit) { $this->quick_moves->add(\POGOProtos\Enums\PokemonMove::valueOf($reader->readVarint($stream))); } continue; } if ($tag === 10) { $innerSize = $reader->readVarint($stream); $innerLimit = $stream->tell() + $innerSize; if ($this->cinematic_moves === null) { $this->cinematic_moves = new \Protobuf\EnumCollection(); } while ($stream->tell() < $innerLimit) { $this->cinematic_moves->add(\POGOProtos\Enums\PokemonMove::valueOf($reader->readVarint($stream))); } continue; } if ($tag === 11) { $innerSize = $reader->readVarint($stream); $innerLimit = $stream->tell() + $innerSize; if ($this->animation_time === null) { $this->animation_time = new \Protobuf\ScalarCollection(); } while ($stream->tell() < $innerLimit) { $this->animation_time->add($reader->readFloat($stream)); } continue; } if ($tag === 12) { $innerSize = $reader->readVarint($stream); $innerLimit = $stream->tell() + $innerSize; if ($this->evolution_ids === null) { $this->evolution_ids = new \Protobuf\EnumCollection(); } while ($stream->tell() < $innerLimit) { $this->evolution_ids->add(\POGOProtos\Enums\PokemonId::valueOf($reader->readVarint($stream))); } continue; } if ($tag === 13) { \Protobuf\WireFormat::assertWireType($wire, 5); $this->evolution_pips = $reader->readVarint($stream); continue; } if ($tag === 14) { \Protobuf\WireFormat::assertWireType($wire, 14); $this->rarity = \POGOProtos\Enums\PokemonRarity::valueOf($reader->readVarint($stream)); continue; } if ($tag === 15) { \Protobuf\WireFormat::assertWireType($wire, 2); $this->pokedex_height_m = $reader->readFloat($stream); continue; } if ($tag === 16) { \Protobuf\WireFormat::assertWireType($wire, 2); $this->pokedex_weight_kg = $reader->readFloat($stream); continue; } if ($tag === 17) { \Protobuf\WireFormat::assertWireType($wire, 14); $this->parent_pokemon_id = \POGOProtos\Enums\PokemonId::valueOf($reader->readVarint($stream)); continue; } if ($tag === 18) { \Protobuf\WireFormat::assertWireType($wire, 2); $this->height_std_dev = $reader->readFloat($stream); continue; } if ($tag === 19) { \Protobuf\WireFormat::assertWireType($wire, 2); $this->weight_std_dev = $reader->readFloat($stream); continue; } if ($tag === 20) { \Protobuf\WireFormat::assertWireType($wire, 2); $this->km_distance_to_hatch = $reader->readFloat($stream); continue; } if ($tag === 21) { \Protobuf\WireFormat::assertWireType($wire, 14); $this->family_id = \POGOProtos\Enums\PokemonFamilyId::valueOf($reader->readVarint($stream)); continue; } if ($tag === 22) { \Protobuf\WireFormat::assertWireType($wire, 5); $this->candy_to_evolve = $reader->readVarint($stream); continue; } if ($tag === 23) { \Protobuf\WireFormat::assertWireType($wire, 2); $this->km_buddy_distance = $reader->readFloat($stream); continue; } if ($tag === 24) { \Protobuf\WireFormat::assertWireType($wire, 14); $this->buddy_size = \POGOProtos\Settings\Master\PokemonSettings\BuddySize::valueOf($reader->readVarint($stream)); continue; } if ($tag === 25) { \Protobuf\WireFormat::assertWireType($wire, 2); $this->model_height = $reader->readFloat($stream); continue; } $extensions = $context->getExtensionRegistry(); $extension = $extensions ? $extensions->findByNumber(__CLASS__, $tag) : null; if ($extension !== null) { $this->extensions()->add($extension, $extension->readFrom($context, $wire)); continue; } if ($this->unknownFieldSet === null) { $this->unknownFieldSet = new \Protobuf\UnknownFieldSet(); } $data = $reader->readUnknown($stream, $wire); $unknown = new \Protobuf\Unknown($tag, $wire, $data); $this->unknownFieldSet->add($unknown); } }
/** * {@inheritdoc} */ public function readFrom(\Protobuf\ReadContext $context) { $reader = $context->getReader(); $length = $context->getLength(); $stream = $context->getStream(); $limit = $length !== null ? $stream->tell() + $length : null; while ($limit === null || $stream->tell() < $limit) { if ($stream->eof()) { break; } $key = $reader->readVarint($stream); $wire = \Protobuf\WireFormat::getTagWireType($key); $tag = \Protobuf\WireFormat::getTagFieldNumber($key); if ($stream->eof()) { break; } if ($tag === 1) { \Protobuf\WireFormat::assertWireType($wire, 8); $this->success = $reader->readBool($stream); continue; } if ($tag === 2) { \Protobuf\WireFormat::assertWireType($wire, 14); $this->family_candy_id = \POGOProtos\Enums\PokemonFamilyId::valueOf($reader->readVarint($stream)); continue; } if ($tag === 3) { \Protobuf\WireFormat::assertWireType($wire, 5); $this->candy_earned_count = $reader->readVarint($stream); continue; } $extensions = $context->getExtensionRegistry(); $extension = $extensions ? $extensions->findByNumber(__CLASS__, $tag) : null; if ($extension !== null) { $this->extensions()->add($extension, $extension->readFrom($context, $wire)); continue; } if ($this->unknownFieldSet === null) { $this->unknownFieldSet = new \Protobuf\UnknownFieldSet(); } $data = $reader->readUnknown($stream, $wire); $unknown = new \Protobuf\Unknown($tag, $wire, $data); $this->unknownFieldSet->add($unknown); } }
/** * {@inheritdoc} */ public function readFrom(\Protobuf\ReadContext $context) { $reader = $context->getReader(); $length = $context->getLength(); $stream = $context->getStream(); $limit = $length !== null ? $stream->tell() + $length : null; while ($limit === null || $stream->tell() < $limit) { if ($stream->eof()) { break; } $key = $reader->readVarint($stream); $wire = \Protobuf\WireFormat::getTagWireType($key); $tag = \Protobuf\WireFormat::getTagFieldNumber($key); if ($stream->eof()) { break; } if ($tag === 1) { \Protobuf\WireFormat::assertWireType($wire, 6); $this->pokemon_id = $reader->readFixed64($stream); continue; } if ($tag === 2) { \Protobuf\WireFormat::assertWireType($wire, 14); $this->item = \POGOProtos\Inventory\Item\ItemId::valueOf($reader->readVarint($stream)); continue; } if ($tag === 3) { \Protobuf\WireFormat::assertWireType($wire, 5); $this->pokedex_entry_id = $reader->readVarint($stream); continue; } if ($tag === 4) { \Protobuf\WireFormat::assertWireType($wire, 8); $this->player_stats = $reader->readBool($stream); continue; } if ($tag === 5) { \Protobuf\WireFormat::assertWireType($wire, 8); $this->player_currency = $reader->readBool($stream); continue; } if ($tag === 6) { \Protobuf\WireFormat::assertWireType($wire, 8); $this->player_camera = $reader->readBool($stream); continue; } if ($tag === 7) { \Protobuf\WireFormat::assertWireType($wire, 8); $this->inventory_upgrades = $reader->readBool($stream); continue; } if ($tag === 8) { \Protobuf\WireFormat::assertWireType($wire, 8); $this->applied_items = $reader->readBool($stream); continue; } if ($tag === 9) { \Protobuf\WireFormat::assertWireType($wire, 8); $this->egg_incubators = $reader->readBool($stream); continue; } if ($tag === 10) { \Protobuf\WireFormat::assertWireType($wire, 14); $this->pokemon_family_id = \POGOProtos\Enums\PokemonFamilyId::valueOf($reader->readVarint($stream)); continue; } if ($tag === 11) { \Protobuf\WireFormat::assertWireType($wire, 14); $this->quest_type = \POGOProtos\Enums\QuestType::valueOf($reader->readVarint($stream)); continue; } $extensions = $context->getExtensionRegistry(); $extension = $extensions ? $extensions->findByNumber(__CLASS__, $tag) : null; if ($extension !== null) { $this->extensions()->add($extension, $extension->readFrom($context, $wire)); continue; } if ($this->unknownFieldSet === null) { $this->unknownFieldSet = new \Protobuf\UnknownFieldSet(); } $data = $reader->readUnknown($stream, $wire); $unknown = new \Protobuf\Unknown($tag, $wire, $data); $this->unknownFieldSet->add($unknown); } }