Ejemplo n.º 1
0
 /**
  * {@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->id = $reader->readFixed64($stream);
             continue;
         }
         if ($tag === 2) {
             \Protobuf\WireFormat::assertWireType($wire, 14);
             $this->pokemon_id = \POGOProtos\Enums\PokemonId::valueOf($reader->readVarint($stream));
             continue;
         }
         if ($tag === 3) {
             \Protobuf\WireFormat::assertWireType($wire, 5);
             $this->cp = $reader->readVarint($stream);
             continue;
         }
         if ($tag === 4) {
             \Protobuf\WireFormat::assertWireType($wire, 5);
             $this->stamina = $reader->readVarint($stream);
             continue;
         }
         if ($tag === 5) {
             \Protobuf\WireFormat::assertWireType($wire, 5);
             $this->stamina_max = $reader->readVarint($stream);
             continue;
         }
         if ($tag === 6) {
             \Protobuf\WireFormat::assertWireType($wire, 14);
             $this->move_1 = \POGOProtos\Enums\PokemonMove::valueOf($reader->readVarint($stream));
             continue;
         }
         if ($tag === 7) {
             \Protobuf\WireFormat::assertWireType($wire, 14);
             $this->move_2 = \POGOProtos\Enums\PokemonMove::valueOf($reader->readVarint($stream));
             continue;
         }
         if ($tag === 8) {
             \Protobuf\WireFormat::assertWireType($wire, 9);
             $this->deployed_fort_id = $reader->readString($stream);
             continue;
         }
         if ($tag === 9) {
             \Protobuf\WireFormat::assertWireType($wire, 9);
             $this->owner_name = $reader->readString($stream);
             continue;
         }
         if ($tag === 10) {
             \Protobuf\WireFormat::assertWireType($wire, 8);
             $this->is_egg = $reader->readBool($stream);
             continue;
         }
         if ($tag === 11) {
             \Protobuf\WireFormat::assertWireType($wire, 1);
             $this->egg_km_walked_target = $reader->readDouble($stream);
             continue;
         }
         if ($tag === 12) {
             \Protobuf\WireFormat::assertWireType($wire, 1);
             $this->egg_km_walked_start = $reader->readDouble($stream);
             continue;
         }
         if ($tag === 14) {
             \Protobuf\WireFormat::assertWireType($wire, 5);
             $this->origin = $reader->readVarint($stream);
             continue;
         }
         if ($tag === 15) {
             \Protobuf\WireFormat::assertWireType($wire, 2);
             $this->height_m = $reader->readFloat($stream);
             continue;
         }
         if ($tag === 16) {
             \Protobuf\WireFormat::assertWireType($wire, 2);
             $this->weight_kg = $reader->readFloat($stream);
             continue;
         }
         if ($tag === 17) {
             \Protobuf\WireFormat::assertWireType($wire, 5);
             $this->individual_attack = $reader->readVarint($stream);
             continue;
         }
         if ($tag === 18) {
             \Protobuf\WireFormat::assertWireType($wire, 5);
             $this->individual_defense = $reader->readVarint($stream);
             continue;
         }
         if ($tag === 19) {
             \Protobuf\WireFormat::assertWireType($wire, 5);
             $this->individual_stamina = $reader->readVarint($stream);
             continue;
         }
         if ($tag === 20) {
             \Protobuf\WireFormat::assertWireType($wire, 2);
             $this->cp_multiplier = $reader->readFloat($stream);
             continue;
         }
         if ($tag === 21) {
             \Protobuf\WireFormat::assertWireType($wire, 14);
             $this->pokeball = \POGOProtos\Inventory\Item\ItemId::valueOf($reader->readVarint($stream));
             continue;
         }
         if ($tag === 22) {
             \Protobuf\WireFormat::assertWireType($wire, 4);
             $this->captured_cell_id = $reader->readVarint($stream);
             continue;
         }
         if ($tag === 23) {
             \Protobuf\WireFormat::assertWireType($wire, 5);
             $this->battles_attacked = $reader->readVarint($stream);
             continue;
         }
         if ($tag === 24) {
             \Protobuf\WireFormat::assertWireType($wire, 5);
             $this->battles_defended = $reader->readVarint($stream);
             continue;
         }
         if ($tag === 25) {
             \Protobuf\WireFormat::assertWireType($wire, 9);
             $this->egg_incubator_id = $reader->readString($stream);
             continue;
         }
         if ($tag === 26) {
             \Protobuf\WireFormat::assertWireType($wire, 4);
             $this->creation_time_ms = $reader->readVarint($stream);
             continue;
         }
         if ($tag === 27) {
             \Protobuf\WireFormat::assertWireType($wire, 5);
             $this->num_upgrades = $reader->readVarint($stream);
             continue;
         }
         if ($tag === 28) {
             \Protobuf\WireFormat::assertWireType($wire, 2);
             $this->additional_cp_multiplier = $reader->readFloat($stream);
             continue;
         }
         if ($tag === 29) {
             \Protobuf\WireFormat::assertWireType($wire, 5);
             $this->favorite = $reader->readVarint($stream);
             continue;
         }
         if ($tag === 30) {
             \Protobuf\WireFormat::assertWireType($wire, 9);
             $this->nickname = $reader->readString($stream);
             continue;
         }
         if ($tag === 31) {
             \Protobuf\WireFormat::assertWireType($wire, 5);
             $this->from_fort = $reader->readVarint($stream);
             continue;
         }
         if ($tag === 32) {
             \Protobuf\WireFormat::assertWireType($wire, 5);
             $this->buddy_candy_awarded = $reader->readVarint($stream);
             continue;
         }
         if ($tag === 33) {
             \Protobuf\WireFormat::assertWireType($wire, 2);
             $this->buddy_total_km_walked = $reader->readFloat($stream);
             continue;
         }
         if ($tag === 34) {
             \Protobuf\WireFormat::assertWireType($wire, 5);
             $this->display_pokemon_id = $reader->readVarint($stream);
             continue;
         }
         if ($tag === 35) {
             \Protobuf\WireFormat::assertWireType($wire, 5);
             $this->display_cp = $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);
     }
 }
Ejemplo n.º 2
0
 /**
  * {@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);
     }
 }
Ejemplo n.º 3
0
 /**
  * {@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->movement_id = \POGOProtos\Enums\PokemonMove::valueOf($reader->readVarint($stream));
             continue;
         }
         if ($tag === 2) {
             \Protobuf\WireFormat::assertWireType($wire, 5);
             $this->animation_id = $reader->readVarint($stream);
             continue;
         }
         if ($tag === 3) {
             \Protobuf\WireFormat::assertWireType($wire, 14);
             $this->pokemon_type = \POGOProtos\Enums\PokemonType::valueOf($reader->readVarint($stream));
             continue;
         }
         if ($tag === 4) {
             \Protobuf\WireFormat::assertWireType($wire, 2);
             $this->power = $reader->readFloat($stream);
             continue;
         }
         if ($tag === 5) {
             \Protobuf\WireFormat::assertWireType($wire, 2);
             $this->accuracy_chance = $reader->readFloat($stream);
             continue;
         }
         if ($tag === 6) {
             \Protobuf\WireFormat::assertWireType($wire, 2);
             $this->critical_chance = $reader->readFloat($stream);
             continue;
         }
         if ($tag === 7) {
             \Protobuf\WireFormat::assertWireType($wire, 2);
             $this->heal_scalar = $reader->readFloat($stream);
             continue;
         }
         if ($tag === 8) {
             \Protobuf\WireFormat::assertWireType($wire, 2);
             $this->stamina_loss_scalar = $reader->readFloat($stream);
             continue;
         }
         if ($tag === 9) {
             \Protobuf\WireFormat::assertWireType($wire, 5);
             $this->trainer_level_min = $reader->readVarint($stream);
             continue;
         }
         if ($tag === 10) {
             \Protobuf\WireFormat::assertWireType($wire, 5);
             $this->trainer_level_max = $reader->readVarint($stream);
             continue;
         }
         if ($tag === 11) {
             \Protobuf\WireFormat::assertWireType($wire, 9);
             $this->vfx_name = $reader->readString($stream);
             continue;
         }
         if ($tag === 12) {
             \Protobuf\WireFormat::assertWireType($wire, 5);
             $this->duration_ms = $reader->readVarint($stream);
             continue;
         }
         if ($tag === 13) {
             \Protobuf\WireFormat::assertWireType($wire, 5);
             $this->damage_window_start_ms = $reader->readVarint($stream);
             continue;
         }
         if ($tag === 14) {
             \Protobuf\WireFormat::assertWireType($wire, 5);
             $this->damage_window_end_ms = $reader->readVarint($stream);
             continue;
         }
         if ($tag === 15) {
             \Protobuf\WireFormat::assertWireType($wire, 5);
             $this->energy_delta = $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);
     }
 }