serializedSize() публичный Метод

public serializedSize ( ComputeSizeContext $context ) : integer
$context Protobuf\ComputeSizeContext
Результат integer
Пример #1
0
 /**
  * {@inheritdoc}
  */
 public function serializedSize(\Protobuf\ComputeSizeContext $context)
 {
     $calculator = $context->getSizeCalculator();
     $size = 0;
     if ($this->modified_timestamp_ms !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->modified_timestamp_ms);
     }
     if ($this->deleted_item !== null) {
         $innerSize = $this->deleted_item->serializedSize($context);
         $size += 1;
         $size += $innerSize;
         $size += $calculator->computeVarintSize($innerSize);
     }
     if ($this->inventory_item_data !== null) {
         $innerSize = $this->inventory_item_data->serializedSize($context);
         $size += 1;
         $size += $innerSize;
         $size += $calculator->computeVarintSize($innerSize);
     }
     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->encounter_id !== null) {
         $size += 1;
         $size += 8;
     }
     if ($this->spawn_point_id !== null) {
         $size += 1;
         $size += $calculator->computeStringSize($this->spawn_point_id);
     }
     if ($this->player_latitude !== null) {
         $size += 1;
         $size += 8;
     }
     if ($this->player_longitude !== null) {
         $size += 1;
         $size += 8;
     }
     if ($this->extensions !== null) {
         $size += $this->extensions->serializedSize($context);
     }
     return $size;
 }
 /**
  * {@inheritdoc}
  */
 public function serializedSize(\Protobuf\ComputeSizeContext $context)
 {
     $calculator = $context->getSizeCalculator();
     $size = 0;
     if ($this->success !== null) {
         $size += 1;
         $size += 1;
     }
     if ($this->awarded_badges !== null) {
         foreach ($this->awarded_badges as $val) {
             $size += 1;
             $size += $calculator->computeVarintSize($val->value());
         }
     }
     if ($this->awarded_badge_levels !== null) {
         foreach ($this->awarded_badge_levels as $val) {
             $size += 1;
             $size += $calculator->computeVarintSize($val);
         }
     }
     if ($this->extensions !== null) {
         $size += $this->extensions->serializedSize($context);
     }
     return $size;
 }
 /**
  * {@inheritdoc}
  */
 public function serializedSize(\Protobuf\ComputeSizeContext $context)
 {
     $calculator = $context->getSizeCalculator();
     $size = 0;
     if ($this->result !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->result->value());
     }
     if ($this->items_awarded !== null) {
         foreach ($this->items_awarded as $val) {
             $innerSize = $val->serializedSize($context);
             $size += 1;
             $size += $innerSize;
             $size += $calculator->computeVarintSize($innerSize);
         }
     }
     if ($this->items_unlocked !== null) {
         foreach ($this->items_unlocked as $val) {
             $size += 1;
             $size += $calculator->computeVarintSize($val->value());
         }
     }
     if ($this->extensions !== null) {
         $size += $this->extensions->serializedSize($context);
     }
     return $size;
 }
 /**
  * {@inheritdoc}
  */
 public function serializedSize(\Protobuf\ComputeSizeContext $context)
 {
     $calculator = $context->getSizeCalculator();
     $size = 0;
     if ($this->max_pokemon !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->max_pokemon);
     }
     if ($this->max_bag_items !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->max_bag_items);
     }
     if ($this->base_pokemon !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->base_pokemon);
     }
     if ($this->base_bag_items !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->base_bag_items);
     }
     if ($this->base_eggs !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->base_eggs);
     }
     if ($this->extensions !== null) {
         $size += $this->extensions->serializedSize($context);
     }
     return $size;
 }
Пример #6
0
 /**
  * {@inheritdoc}
  */
 public function serializedSize(\Protobuf\ComputeSizeContext $context)
 {
     $calculator = $context->getSizeCalculator();
     $size = 0;
     if ($this->pokemon_data !== null) {
         $innerSize = $this->pokemon_data->serializedSize($context);
         $size += 1;
         $size += $innerSize;
         $size += $calculator->computeVarintSize($innerSize);
     }
     if ($this->trainer_public_profile !== null) {
         $innerSize = $this->trainer_public_profile->serializedSize($context);
         $size += 1;
         $size += $innerSize;
         $size += $calculator->computeVarintSize($innerSize);
     }
     if ($this->training_pokemon !== null) {
         $innerSize = $this->training_pokemon->serializedSize($context);
         $size += 1;
         $size += $innerSize;
         $size += $calculator->computeVarintSize($innerSize);
     }
     if ($this->extensions !== null) {
         $size += $this->extensions->serializedSize($context);
     }
     return $size;
 }
 /**
  * {@inheritdoc}
  */
 public function serializedSize(\Protobuf\ComputeSizeContext $context)
 {
     $calculator = $context->getSizeCalculator();
     $size = 0;
     if ($this->result !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->result->value());
     }
     if ($this->currency_type !== null) {
         foreach ($this->currency_type as $val) {
             $size += 1;
             $size += $calculator->computeStringSize($val);
         }
     }
     if ($this->currency_awarded !== null) {
         foreach ($this->currency_awarded as $val) {
             $size += 1;
             $size += $calculator->computeVarintSize($val);
         }
     }
     if ($this->defenders_count !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->defenders_count);
     }
     if ($this->extensions !== null) {
         $size += $this->extensions->serializedSize($context);
     }
     return $size;
 }
 /**
  * {@inheritdoc}
  */
 public function serializedSize(\Protobuf\ComputeSizeContext $context)
 {
     $calculator = $context->getSizeCalculator();
     $size = 0;
     if ($this->name !== null) {
         $size += 1;
         $size += $calculator->computeStringSize($this->name);
     }
     if ($this->value !== null) {
         foreach ($this->value as $val) {
             $innerSize = $val->serializedSize($context);
             $size += 1;
             $size += $innerSize;
             $size += $calculator->computeVarintSize($innerSize);
         }
     }
     if ($this->options !== null) {
         $innerSize = $this->options->serializedSize($context);
         $size += 1;
         $size += $innerSize;
         $size += $calculator->computeVarintSize($innerSize);
     }
     if ($this->extensions !== null) {
         $size += $this->extensions->serializedSize($context);
     }
     return $size;
 }
Пример #9
0
 /**
  * {@inheritdoc}
  */
 public function serializedSize(\Protobuf\ComputeSizeContext $context)
 {
     $calculator = $context->getSizeCalculator();
     $size = 0;
     if ($this->disk_radius_m !== null) {
         $size += 1;
         $size += 4;
     }
     if ($this->cylinder_radius_m !== null) {
         $size += 1;
         $size += 4;
     }
     if ($this->cylinder_height_m !== null) {
         $size += 1;
         $size += 4;
     }
     if ($this->cylinder_ground_m !== null) {
         $size += 1;
         $size += 4;
     }
     if ($this->shoulder_mode_scale !== null) {
         $size += 1;
         $size += 4;
     }
     if ($this->extensions !== null) {
         $size += $this->extensions->serializedSize($context);
     }
     return $size;
 }
 /**
  * {@inheritdoc}
  */
 public function serializedSize(\Protobuf\ComputeSizeContext $context)
 {
     $calculator = $context->getSizeCalculator();
     $size = 0;
     if ($this->pokeball_type !== null) {
         $innerSize = 0;
         foreach ($this->pokeball_type as $val) {
             $innerSize += $calculator->computeVarintSize($val->value());
         }
         $size += 1;
         $size += $innerSize;
         $size += $calculator->computeVarintSize($innerSize);
     }
     if ($this->capture_probability !== null) {
         $innerSize = 0;
         foreach ($this->capture_probability as $val) {
             $innerSize += 4;
         }
         $size += 1;
         $size += $innerSize;
         $size += $calculator->computeVarintSize($innerSize);
     }
     if ($this->reticle_difficulty_scale !== null) {
         $size += 1;
         $size += 8;
     }
     if ($this->extensions !== null) {
         $size += $this->extensions->serializedSize($context);
     }
     return $size;
 }
 /**
  * {@inheritdoc}
  */
 public function serializedSize(\Protobuf\ComputeSizeContext $context)
 {
     $calculator = $context->getSizeCalculator();
     $size = 0;
     if ($this->equip_badge_cooldown_ms !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->equip_badge_cooldown_ms);
     }
     if ($this->catch_probability_bonus !== null) {
         foreach ($this->catch_probability_bonus as $val) {
             $size += 1;
             $size += 4;
         }
     }
     if ($this->flee_probability_bonus !== null) {
         foreach ($this->flee_probability_bonus as $val) {
             $size += 1;
             $size += 4;
         }
     }
     if ($this->extensions !== null) {
         $size += $this->extensions->serializedSize($context);
     }
     return $size;
 }
 /**
  * {@inheritdoc}
  */
 public function serializedSize(\Protobuf\ComputeSizeContext $context)
 {
     $calculator = $context->getSizeCalculator();
     $size = 0;
     if ($this->gym_state !== null) {
         $innerSize = $this->gym_state->serializedSize($context);
         $size += 1;
         $size += $innerSize;
         $size += $calculator->computeVarintSize($innerSize);
     }
     if ($this->name !== null) {
         $size += 1;
         $size += $calculator->computeStringSize($this->name);
     }
     if ($this->urls !== null) {
         foreach ($this->urls as $val) {
             $size += 1;
             $size += $calculator->computeStringSize($val);
         }
     }
     if ($this->result !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->result->value());
     }
     if ($this->description !== null) {
         $size += 1;
         $size += $calculator->computeStringSize($this->description);
     }
     if ($this->extensions !== null) {
         $size += $this->extensions->serializedSize($context);
     }
     return $size;
 }
 /**
  * {@inheritdoc}
  */
 public function serializedSize(\Protobuf\ComputeSizeContext $context)
 {
     $calculator = $context->getSizeCalculator();
     $size = 0;
     if ($this->platform !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->platform->value());
     }
     if ($this->device_manufacturer !== null) {
         $size += 1;
         $size += $calculator->computeStringSize($this->device_manufacturer);
     }
     if ($this->device_model !== null) {
         $size += 1;
         $size += $calculator->computeStringSize($this->device_model);
     }
     if ($this->locale !== null) {
         $size += 1;
         $size += $calculator->computeStringSize($this->locale);
     }
     if ($this->app_version !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->app_version);
     }
     if ($this->extensions !== null) {
         $size += $this->extensions->serializedSize($context);
     }
     return $size;
 }
 /**
  * {@inheritdoc}
  */
 public function serializedSize(\Protobuf\ComputeSizeContext $context)
 {
     $calculator = $context->getSizeCalculator();
     $size = 0;
     if ($this->item_effect !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->item_effect->value());
     }
     if ($this->capture_multi !== null) {
         $size += 1;
         $size += 4;
     }
     if ($this->capture_multi_effect !== null) {
         $size += 1;
         $size += 4;
     }
     if ($this->item_effect_mod !== null) {
         $size += 1;
         $size += 4;
     }
     if ($this->extensions !== null) {
         $size += $this->extensions->serializedSize($context);
     }
     return $size;
 }
 /**
  * {@inheritdoc}
  */
 public function serializedSize(\Protobuf\ComputeSizeContext $context)
 {
     $calculator = $context->getSizeCalculator();
     $size = 0;
     if ($this->modifier_type !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->modifier_type->value());
     }
     if ($this->fort_id !== null) {
         $size += 1;
         $size += $calculator->computeStringSize($this->fort_id);
     }
     if ($this->player_latitude !== null) {
         $size += 1;
         $size += 8;
     }
     if ($this->player_longitude !== null) {
         $size += 1;
         $size += 8;
     }
     if ($this->extensions !== null) {
         $size += $this->extensions->serializedSize($context);
     }
     return $size;
 }
Пример #16
0
 /**
  * {@inheritdoc}
  */
 public function serializedSize(\Protobuf\ComputeSizeContext $context)
 {
     $calculator = $context->getSizeCalculator();
     $size = 0;
     if ($this->interaction_range_meters !== null) {
         $size += 1;
         $size += 8;
     }
     if ($this->max_total_deployed_pokemon !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->max_total_deployed_pokemon);
     }
     if ($this->max_player_deployed_pokemon !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->max_player_deployed_pokemon);
     }
     if ($this->deploy_stamina_multiplier !== null) {
         $size += 1;
         $size += 8;
     }
     if ($this->deploy_attack_multiplier !== null) {
         $size += 1;
         $size += 8;
     }
     if ($this->far_interaction_range_meters !== null) {
         $size += 1;
         $size += 8;
     }
     if ($this->extensions !== null) {
         $size += $this->extensions->serializedSize($context);
     }
     return $size;
 }
 /**
  * {@inheritdoc}
  */
 public function serializedSize(\Protobuf\ComputeSizeContext $context)
 {
     $calculator = $context->getSizeCalculator();
     $size = 0;
     if ($this->gym_id !== null) {
         $size += 1;
         $size += $calculator->computeStringSize($this->gym_id);
     }
     if ($this->attacking_pokemon_ids !== null) {
         foreach ($this->attacking_pokemon_ids as $val) {
             $size += 1;
             $size += 8;
         }
     }
     if ($this->defending_pokemon_id !== null) {
         $size += 1;
         $size += 8;
     }
     if ($this->player_latitude !== null) {
         $size += 1;
         $size += 8;
     }
     if ($this->player_longitude !== null) {
         $size += 1;
         $size += 8;
     }
     if ($this->extensions !== null) {
         $size += $this->extensions->serializedSize($context);
     }
     return $size;
 }
 /**
  * {@inheritdoc}
  */
 public function serializedSize(\Protobuf\ComputeSizeContext $context)
 {
     $calculator = $context->getSizeCalculator();
     $size = 0;
     if ($this->codename !== null) {
         $size += 1;
         $size += $calculator->computeStringSize($this->codename);
     }
     if ($this->user_message !== null) {
         $size += 1;
         $size += $calculator->computeStringSize($this->user_message);
     }
     if ($this->is_assignable !== null) {
         $size += 1;
         $size += 1;
     }
     if ($this->status !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->status->value());
     }
     if ($this->extensions !== null) {
         $size += $this->extensions->serializedSize($context);
     }
     return $size;
 }
Пример #19
0
 /**
  * {@inheritdoc}
  */
 public function serializedSize(\Protobuf\ComputeSizeContext $context)
 {
     $calculator = $context->getSizeCalculator();
     $size = 0;
     if ($this->badge_type !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->badge_type->value());
     }
     if ($this->badge_rank !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->badge_rank);
     }
     if ($this->targets !== null) {
         foreach ($this->targets as $val) {
             $size += 1;
             $size += $calculator->computeVarintSize($val);
         }
     }
     if ($this->capture_reward !== null) {
         foreach ($this->capture_reward as $val) {
             $innerSize = $val->serializedSize($context);
             $size += 1;
             $size += $innerSize;
             $size += $calculator->computeVarintSize($innerSize);
         }
     }
     if ($this->extensions !== null) {
         $size += $this->extensions->serializedSize($context);
     }
     return $size;
 }
Пример #20
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->distance_in_meters !== null) {
         $size += 1;
         $size += 4;
     }
     if ($this->encounter_id !== null) {
         $size += 1;
         $size += 8;
     }
     if ($this->fort_id !== null) {
         $size += 1;
         $size += $calculator->computeStringSize($this->fort_id);
     }
     if ($this->fort_image_url !== null) {
         $size += 1;
         $size += $calculator->computeStringSize($this->fort_image_url);
     }
     if ($this->extensions !== null) {
         $size += $this->extensions->serializedSize($context);
     }
     return $size;
 }
 /**
  * {@inheritdoc}
  */
 public function serializedSize(\Protobuf\ComputeSizeContext $context)
 {
     $calculator = $context->getSizeCalculator();
     $size = 0;
     if ($this->result !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->result->value());
     }
     if ($this->pokemon_id !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->pokemon_id->value());
     }
     if ($this->combat_points !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->combat_points);
     }
     if ($this->pokemon_data_id !== null) {
         $size += 1;
         $size += 8;
     }
     if ($this->extensions !== null) {
         $size += $this->extensions->serializedSize($context);
     }
     return $size;
 }
 /**
  * {@inheritdoc}
  */
 public function serializedSize(\Protobuf\ComputeSizeContext $context)
 {
     $calculator = $context->getSizeCalculator();
     $size = 0;
     if ($this->status !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->status->value());
     }
     if ($this->items !== null) {
         foreach ($this->items as $val) {
             $innerSize = $val->serializedSize($context);
             $size += 1;
             $size += $innerSize;
             $size += $calculator->computeVarintSize($innerSize);
         }
     }
     if ($this->player_currencies !== null) {
         foreach ($this->player_currencies as $val) {
             $innerSize = $val->serializedSize($context);
             $size += 1;
             $size += $innerSize;
             $size += $calculator->computeVarintSize($innerSize);
         }
     }
     if ($this->unknown4 !== null) {
         $size += 1;
         $size += $calculator->computeStringSize($this->unknown4);
     }
     if ($this->extensions !== null) {
         $size += $this->extensions->serializedSize($context);
     }
     return $size;
 }
 /**
  * {@inheritdoc}
  */
 public function serializedSize(\Protobuf\ComputeSizeContext $context)
 {
     $calculator = $context->getSizeCalculator();
     $size = 0;
     if ($this->result !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->result->value());
     }
     if ($this->pokemon_data !== null) {
         $innerSize = $this->pokemon_data->serializedSize($context);
         $size += 1;
         $size += $innerSize;
         $size += $calculator->computeVarintSize($innerSize);
     }
     if ($this->capture_probability !== null) {
         $innerSize = $this->capture_probability->serializedSize($context);
         $size += 1;
         $size += $innerSize;
         $size += $calculator->computeVarintSize($innerSize);
     }
     if ($this->extensions !== null) {
         $size += $this->extensions->serializedSize($context);
     }
     return $size;
 }
 /**
  * {@inheritdoc}
  */
 public function serializedSize(\Protobuf\ComputeSizeContext $context)
 {
     $calculator = $context->getSizeCalculator();
     $size = 0;
     if ($this->file_to_generate !== null) {
         foreach ($this->file_to_generate as $val) {
             $size += 1;
             $size += $calculator->computeStringSize($val);
         }
     }
     if ($this->parameter !== null) {
         $size += 1;
         $size += $calculator->computeStringSize($this->parameter);
     }
     if ($this->proto_file !== null) {
         foreach ($this->proto_file as $val) {
             $innerSize = $val->serializedSize($context);
             $size += 1;
             $size += $innerSize;
             $size += $calculator->computeVarintSize($innerSize);
         }
     }
     if ($this->extensions !== null) {
         $size += $this->extensions->serializedSize($context);
     }
     return $size;
 }
Пример #25
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->times_encountered !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->times_encountered);
     }
     if ($this->times_captured !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->times_captured);
     }
     if ($this->evolution_stone_pieces !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->evolution_stone_pieces);
     }
     if ($this->evolution_stones !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->evolution_stones);
     }
     if ($this->extensions !== null) {
         $size += $this->extensions->serializedSize($context);
     }
     return $size;
 }
Пример #26
0
 /**
  * {@inheritdoc}
  */
 public function serializedSize(\Protobuf\ComputeSizeContext $context)
 {
     $calculator = $context->getSizeCalculator();
     $size = 0;
     if ($this->asset_id !== null) {
         $size += 1;
         $size += $calculator->computeStringSize($this->asset_id);
     }
     if ($this->url !== null) {
         $size += 1;
         $size += $calculator->computeStringSize($this->url);
     }
     if ($this->size !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->size);
     }
     if ($this->checksum !== null) {
         $size += 1;
         $size += 4;
     }
     if ($this->extensions !== null) {
         $size += $this->extensions->serializedSize($context);
     }
     return $size;
 }
Пример #27
0
 /**
  * {@inheritdoc}
  */
 public function serializedSize(\Protobuf\ComputeSizeContext $context)
 {
     $calculator = $context->getSizeCalculator();
     $size = 0;
     if ($this->fort_id !== null) {
         $size += 1;
         $size += $calculator->computeStringSize($this->fort_id);
     }
     if ($this->encounter_id !== null) {
         $size += 1;
         $size += 8;
     }
     if ($this->active_pokemon_id !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->active_pokemon_id->value());
     }
     if ($this->lure_expires_timestamp_ms !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->lure_expires_timestamp_ms);
     }
     if ($this->extensions !== null) {
         $size += $this->extensions->serializedSize($context);
     }
     return $size;
 }
Пример #28
0
 /**
  * {@inheritdoc}
  */
 public function serializedSize(\Protobuf\ComputeSizeContext $context)
 {
     $calculator = $context->getSizeCalculator();
     $size = 0;
     if ($this->badge_type !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->badge_type->value());
     }
     if ($this->rank !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->rank);
     }
     if ($this->start_value !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->start_value);
     }
     if ($this->end_value !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->end_value);
     }
     if ($this->current_value !== null) {
         $size += 1;
         $size += 8;
     }
     if ($this->extensions !== null) {
         $size += $this->extensions->serializedSize($context);
     }
     return $size;
 }
 /**
  * {@inheritdoc}
  */
 public function serializedSize(\Protobuf\ComputeSizeContext $context)
 {
     $calculator = $context->getSizeCalculator();
     $size = 0;
     if ($this->buckets_per_day !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->buckets_per_day);
     }
     if ($this->streak_length !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->streak_length);
     }
     if ($this->bonus_multiplier !== null) {
         $size += 1;
         $size += 4;
     }
     if ($this->streak_bonus_multiplier !== null) {
         $size += 1;
         $size += 4;
     }
     if ($this->extensions !== null) {
         $size += $this->extensions->serializedSize($context);
     }
     return $size;
 }
Пример #30
0
 /**
  * {@inheritdoc}
  */
 public function serializedSize(\Protobuf\ComputeSizeContext $context)
 {
     $calculator = $context->getSizeCalculator();
     $size = 0;
     if ($this->wild_pokemon !== null) {
         $innerSize = $this->wild_pokemon->serializedSize($context);
         $size += 1;
         $size += $innerSize;
         $size += $calculator->computeVarintSize($innerSize);
     }
     if ($this->background !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->background->value());
     }
     if ($this->status !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->status->value());
     }
     if ($this->capture_probability !== null) {
         $innerSize = $this->capture_probability->serializedSize($context);
         $size += 1;
         $size += $innerSize;
         $size += $calculator->computeVarintSize($innerSize);
     }
     if ($this->extensions !== null) {
         $size += $this->extensions->serializedSize($context);
     }
     return $size;
 }