當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Protobuf\ComputeSizeContext類代碼示例

本文整理匯總了PHP中Protobuf\ComputeSizeContext的典型用法代碼示例。如果您正苦於以下問題:PHP ComputeSizeContext類的具體用法?PHP ComputeSizeContext怎麽用?PHP ComputeSizeContext使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了ComputeSizeContext類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: serializedSize

 /**
  * {@inheritdoc}
  */
 public function serializedSize(\Protobuf\ComputeSizeContext $context)
 {
     $calculator = $context->getSizeCalculator();
     $size = 0;
     if ($this->current_period_bucket !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->current_period_bucket);
     }
     if ($this->current_streak_count !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->current_streak_count);
     }
     if ($this->extensions !== null) {
         $size += $this->extensions->serializedSize($context);
     }
     return $size;
 }
開發者ID:jaspervdm,項目名稱:pogoprotos-php,代碼行數:20,代碼來源:DailyQuest.php

示例2: serializedSize

 /**
  * {@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->team_color !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->team_color->value());
     }
     if ($this->pokemon_data !== null) {
         $innerSize = $this->pokemon_data->serializedSize($context);
         $size += 1;
         $size += $innerSize;
         $size += $calculator->computeVarintSize($innerSize);
     }
     if ($this->name !== null) {
         $size += 1;
         $size += $calculator->computeStringSize($this->name);
     }
     if ($this->image_urls !== null) {
         foreach ($this->image_urls as $val) {
             $size += 1;
             $size += $calculator->computeStringSize($val);
         }
     }
     if ($this->fp !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->fp);
     }
     if ($this->stamina !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->stamina);
     }
     if ($this->max_stamina !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->max_stamina);
     }
     if ($this->type !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->type->value());
     }
     if ($this->latitude !== null) {
         $size += 1;
         $size += 8;
     }
     if ($this->longitude !== null) {
         $size += 1;
         $size += 8;
     }
     if ($this->description !== null) {
         $size += 1;
         $size += $calculator->computeStringSize($this->description);
     }
     if ($this->modifiers !== null) {
         foreach ($this->modifiers 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;
 }
開發者ID:jaspervdm,項目名稱:pogoprotos-php,代碼行數:72,代碼來源:FortDetailsResponse.php

示例3: serializedSize

 /**
  * {@inheritdoc}
  */
 public function serializedSize(\Protobuf\ComputeSizeContext $context)
 {
     $calculator = $context->getSizeCalculator();
     $size = 0;
     if ($this->incense_type !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->incense_type->value());
     }
     if ($this->extensions !== null) {
         $size += $this->extensions->serializedSize($context);
     }
     return $size;
 }
開發者ID:jaspervdm,項目名稱:pogoprotos-php,代碼行數:16,代碼來源:UseIncenseMessage.php

示例4: serializedSize

 /**
  * {@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;
 }
開發者ID:jaspervdm,項目名稱:pogoprotos-php,代碼行數:28,代碼來源:FortLureInfo.php

示例5: serializedSize

 /**
  * {@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->log_entries !== null) {
         foreach ($this->log_entries 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;
 }
開發者ID:jaspervdm,項目名稱:pogoprotos-php,代碼行數:24,代碼來源:SfidaActionLogResponse.php

示例6: serializedSize

 /**
  * {@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;
 }
開發者ID:jaspervdm,項目名稱:pogoprotos-php,代碼行數:32,代碼來源:PokedexEntry.php

示例7: serializedSize

 /**
  * {@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;
 }
開發者ID:jaspervdm,項目名稱:pogoprotos-php,代碼行數:28,代碼來源:EncounterMessage.php

示例8: serializedSize

 /**
  * {@inheritdoc}
  */
 public function serializedSize(\Protobuf\ComputeSizeContext $context)
 {
     $calculator = $context->getSizeCalculator();
     $size = 0;
     if ($this->name_part !== null) {
         $size += 1;
         $size += $calculator->computeStringSize($this->name_part);
     }
     if ($this->is_extension !== null) {
         $size += 1;
         $size += 1;
     }
     if ($this->extensions !== null) {
         $size += $this->extensions->serializedSize($context);
     }
     return $size;
 }
開發者ID:protobuf-php,項目名稱:google-protobuf-proto,代碼行數:20,代碼來源:NamePart.php

示例9: serializedSize

 /**
  * {@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;
 }
開發者ID:jaspervdm,項目名稱:pogoprotos-php,代碼行數:32,代碼來源:InventorySettings.php

示例10: serializedSize

 /**
  * {@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->number !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->number);
     }
     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;
 }
開發者ID:protobuf-php,項目名稱:google-protobuf-proto,代碼行數:26,代碼來源:EnumValueDescriptorProto.php

示例11: serializedSize

 /**
  * {@inheritdoc}
  */
 public function serializedSize(\Protobuf\ComputeSizeContext $context)
 {
     $calculator = $context->getSizeCalculator();
     $size = 0;
     if ($this->active_pokemon !== null) {
         $innerSize = $this->active_pokemon->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->reverse_pokemon !== null) {
         foreach ($this->reverse_pokemon as $val) {
             $innerSize = $val->serializedSize($context);
             $size += 1;
             $size += $innerSize;
             $size += $calculator->computeVarintSize($innerSize);
         }
     }
     if ($this->defeated_pokemon !== null) {
         foreach ($this->defeated_pokemon 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;
 }
開發者ID:jaspervdm,項目名稱:pogoprotos-php,代碼行數:40,代碼來源:BattleParticipant.php

示例12: serializedSize

 /**
  * {@inheritdoc}
  */
 public function serializedSize(\Protobuf\ComputeSizeContext $context)
 {
     $calculator = $context->getSizeCalculator();
     $size = 0;
     if ($this->activity_type !== null) {
         $innerSize = 0;
         foreach ($this->activity_type as $val) {
             $innerSize += $calculator->computeVarintSize($val->value());
         }
         $size += 1;
         $size += $innerSize;
         $size += $calculator->computeVarintSize($innerSize);
     }
     if ($this->xp !== null) {
         $innerSize = 0;
         foreach ($this->xp as $val) {
             $innerSize += $calculator->computeVarintSize($val);
         }
         $size += 1;
         $size += $innerSize;
         $size += $calculator->computeVarintSize($innerSize);
     }
     if ($this->candy !== null) {
         $innerSize = 0;
         foreach ($this->candy as $val) {
             $innerSize += $calculator->computeVarintSize($val);
         }
         $size += 1;
         $size += $innerSize;
         $size += $calculator->computeVarintSize($innerSize);
     }
     if ($this->stardust !== null) {
         $innerSize = 0;
         foreach ($this->stardust as $val) {
             $innerSize += $calculator->computeVarintSize($val);
         }
         $size += 1;
         $size += $innerSize;
         $size += $calculator->computeVarintSize($innerSize);
     }
     if ($this->extensions !== null) {
         $size += $this->extensions->serializedSize($context);
     }
     return $size;
 }
開發者ID:jaspervdm,項目名稱:pogoprotos-php,代碼行數:48,代碼來源:CaptureAward.php

示例13: serializedSize

 /**
  * {@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->number !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->number);
     }
     if ($this->label !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->label->value());
     }
     if ($this->type !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->type->value());
     }
     if ($this->type_name !== null) {
         $size += 1;
         $size += $calculator->computeStringSize($this->type_name);
     }
     if ($this->extendee !== null) {
         $size += 1;
         $size += $calculator->computeStringSize($this->extendee);
     }
     if ($this->default_value !== null) {
         $size += 1;
         $size += $calculator->computeStringSize($this->default_value);
     }
     if ($this->oneof_index !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->oneof_index);
     }
     if ($this->json_name !== null) {
         $size += 1;
         $size += $calculator->computeStringSize($this->json_name);
     }
     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;
 }
開發者ID:protobuf-php,項目名稱:google-protobuf-proto,代碼行數:54,代碼來源:FieldDescriptorProto.php

示例14: serializedSize

 /**
  * {@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;
 }
開發者ID:jaspervdm,項目名稱:pogoprotos-php,代碼行數:28,代碼來源:IncenseEncounterResponse.php

示例15: serializedSize

 /**
  * {@inheritdoc}
  */
 public function serializedSize(\Protobuf\ComputeSizeContext $context)
 {
     $calculator = $context->getSizeCalculator();
     $size = 0;
     if ($this->encounter_id !== null) {
         $size += 1;
         $size += 8;
     }
     if ($this->last_modified_timestamp_ms !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->last_modified_timestamp_ms);
     }
     if ($this->latitude !== null) {
         $size += 1;
         $size += 8;
     }
     if ($this->longitude !== null) {
         $size += 1;
         $size += 8;
     }
     if ($this->spawn_point_id !== null) {
         $size += 1;
         $size += $calculator->computeStringSize($this->spawn_point_id);
     }
     if ($this->pokemon_data !== null) {
         $innerSize = $this->pokemon_data->serializedSize($context);
         $size += 1;
         $size += $innerSize;
         $size += $calculator->computeVarintSize($innerSize);
     }
     if ($this->time_till_hidden_ms !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->time_till_hidden_ms);
     }
     if ($this->extensions !== null) {
         $size += $this->extensions->serializedSize($context);
     }
     return $size;
 }
開發者ID:jaspervdm,項目名稱:pogoprotos-php,代碼行數:42,代碼來源:WildPokemon.php


注:本文中的Protobuf\ComputeSizeContext類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。