/**
  * {@inheritdoc}
  */
 public function serializedSize(\Protobuf\ComputeSizeContext $context)
 {
     $calculator = $context->getSizeCalculator();
     $size = 0;
     if ($this->attack_scalar !== null) {
         foreach ($this->attack_scalar as $val) {
             $size += 1;
             $size += 4;
         }
     }
     if ($this->attack_type !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->attack_type->value());
     }
     if ($this->extensions !== null) {
         $size += $this->extensions->serializedSize($context);
     }
     return $size;
 }
Пример #2
0
 /**
  * {@inheritdoc}
  */
 public function serializedSize(\Protobuf\ComputeSizeContext $context)
 {
     $calculator = $context->getSizeCalculator();
     $size = 0;
     if ($this->pokemon_id !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->pokemon_id->value());
     }
     if ($this->model_scale !== null) {
         $size += 1;
         $size += 4;
     }
     if ($this->type !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->type->value());
     }
     if ($this->type_2 !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->type_2->value());
     }
     if ($this->camera !== null) {
         $innerSize = $this->camera->serializedSize($context);
         $size += 1;
         $size += $innerSize;
         $size += $calculator->computeVarintSize($innerSize);
     }
     if ($this->encounter !== null) {
         $innerSize = $this->encounter->serializedSize($context);
         $size += 1;
         $size += $innerSize;
         $size += $calculator->computeVarintSize($innerSize);
     }
     if ($this->stats !== null) {
         $innerSize = $this->stats->serializedSize($context);
         $size += 1;
         $size += $innerSize;
         $size += $calculator->computeVarintSize($innerSize);
     }
     if ($this->quick_moves !== null) {
         foreach ($this->quick_moves as $val) {
             $size += 1;
             $size += $calculator->computeVarintSize($val->value());
         }
     }
     if ($this->cinematic_moves !== null) {
         foreach ($this->cinematic_moves as $val) {
             $size += 1;
             $size += $calculator->computeVarintSize($val->value());
         }
     }
     if ($this->animation_time !== null) {
         foreach ($this->animation_time as $val) {
             $size += 1;
             $size += 4;
         }
     }
     if ($this->evolution_ids !== null) {
         foreach ($this->evolution_ids as $val) {
             $size += 1;
             $size += $calculator->computeVarintSize($val->value());
         }
     }
     if ($this->evolution_pips !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->evolution_pips);
     }
     if ($this->rarity !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->rarity->value());
     }
     if ($this->pokedex_height_m !== null) {
         $size += 1;
         $size += 4;
     }
     if ($this->pokedex_weight_kg !== null) {
         $size += 2;
         $size += 4;
     }
     if ($this->parent_pokemon_id !== null) {
         $size += 2;
         $size += $calculator->computeVarintSize($this->parent_pokemon_id->value());
     }
     if ($this->height_std_dev !== null) {
         $size += 2;
         $size += 4;
     }
     if ($this->weight_std_dev !== null) {
         $size += 2;
         $size += 4;
     }
     if ($this->km_distance_to_hatch !== null) {
         $size += 2;
         $size += 4;
     }
     if ($this->family_id !== null) {
         $size += 2;
         $size += $calculator->computeVarintSize($this->family_id->value());
     }
     if ($this->candy_to_evolve !== null) {
         $size += 2;
         $size += $calculator->computeVarintSize($this->candy_to_evolve);
     }
     if ($this->km_buddy_distance !== null) {
         $size += 2;
         $size += 4;
     }
     if ($this->buddy_size !== null) {
         $size += 2;
         $size += $calculator->computeVarintSize($this->buddy_size->value());
     }
     if ($this->model_height !== null) {
         $size += 2;
         $size += 4;
     }
     if ($this->extensions !== null) {
         $size += $this->extensions->serializedSize($context);
     }
     return $size;
 }
Пример #3
0
 /**
  * {@inheritdoc}
  */
 public function serializedSize(\Protobuf\ComputeSizeContext $context)
 {
     $calculator = $context->getSizeCalculator();
     $size = 0;
     if ($this->movement_id !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->movement_id->value());
     }
     if ($this->animation_id !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->animation_id);
     }
     if ($this->pokemon_type !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->pokemon_type->value());
     }
     if ($this->power !== null) {
         $size += 1;
         $size += 4;
     }
     if ($this->accuracy_chance !== null) {
         $size += 1;
         $size += 4;
     }
     if ($this->critical_chance !== null) {
         $size += 1;
         $size += 4;
     }
     if ($this->heal_scalar !== null) {
         $size += 1;
         $size += 4;
     }
     if ($this->stamina_loss_scalar !== null) {
         $size += 1;
         $size += 4;
     }
     if ($this->trainer_level_min !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->trainer_level_min);
     }
     if ($this->trainer_level_max !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->trainer_level_max);
     }
     if ($this->vfx_name !== null) {
         $size += 1;
         $size += $calculator->computeStringSize($this->vfx_name);
     }
     if ($this->duration_ms !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->duration_ms);
     }
     if ($this->damage_window_start_ms !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->damage_window_start_ms);
     }
     if ($this->damage_window_end_ms !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->damage_window_end_ms);
     }
     if ($this->energy_delta !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->energy_delta);
     }
     if ($this->extensions !== null) {
         $size += $this->extensions->serializedSize($context);
     }
     return $size;
 }