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


PHP Protobuf\WriteContext類代碼示例

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


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

示例1: writeTo

 /**
  * {@inheritdoc}
  */
 public function writeTo(\Protobuf\WriteContext $context)
 {
     $stream = $context->getStream();
     $writer = $context->getWriter();
     $sizeContext = $context->getComputeSizeContext();
     if ($this->extensions !== null) {
         $this->extensions->writeTo($context);
     }
     return $stream;
 }
開發者ID:jaspervdm,項目名稱:pogoprotos-php,代碼行數:13,代碼來源:EchoMessage.php

示例2: writeTo

 /**
  * {@inheritdoc}
  */
 public function writeTo(\Protobuf\WriteContext $context)
 {
     $stream = $context->getStream();
     $writer = $context->getWriter();
     $sizeContext = $context->getComputeSizeContext();
     if ($this->item_id !== null) {
         $writer->writeVarint($stream, 8);
         $writer->writeVarint($stream, $this->item_id->value());
     }
     if ($this->pokemon_id !== null) {
         $writer->writeVarint($stream, 17);
         $writer->writeFixed64($stream, $this->pokemon_id);
     }
     if ($this->extensions !== null) {
         $this->extensions->writeTo($context);
     }
     return $stream;
 }
開發者ID:jaspervdm,項目名稱:pogoprotos-php,代碼行數:21,代碼來源:UseItemReviveMessage.php

示例3: writeTo

 /**
  * {@inheritdoc}
  */
 public function writeTo(\Protobuf\WriteContext $context)
 {
     $stream = $context->getStream();
     $writer = $context->getWriter();
     $sizeContext = $context->getComputeSizeContext();
     if ($this->incense_type !== null) {
         $writer->writeVarint($stream, 8);
         $writer->writeVarint($stream, $this->incense_type->value());
     }
     if ($this->extensions !== null) {
         $this->extensions->writeTo($context);
     }
     return $stream;
 }
開發者ID:jaspervdm,項目名稱:pogoprotos-php,代碼行數:17,代碼來源:UseIncenseMessage.php

示例4: writeTo

 /**
  * {@inheritdoc}
  */
 public function writeTo(\Protobuf\WriteContext $context)
 {
     $stream = $context->getStream();
     $writer = $context->getWriter();
     $sizeContext = $context->getComputeSizeContext();
     if ($this->fort_id !== null) {
         $writer->writeVarint($stream, 10);
         $writer->writeString($stream, $this->fort_id);
     }
     if ($this->team_color !== null) {
         $writer->writeVarint($stream, 16);
         $writer->writeVarint($stream, $this->team_color->value());
     }
     if ($this->pokemon_data !== null) {
         $writer->writeVarint($stream, 26);
         $writer->writeVarint($stream, $this->pokemon_data->serializedSize($sizeContext));
         $this->pokemon_data->writeTo($context);
     }
     if ($this->name !== null) {
         $writer->writeVarint($stream, 34);
         $writer->writeString($stream, $this->name);
     }
     if ($this->image_urls !== null) {
         foreach ($this->image_urls as $val) {
             $writer->writeVarint($stream, 42);
             $writer->writeString($stream, $val);
         }
     }
     if ($this->fp !== null) {
         $writer->writeVarint($stream, 48);
         $writer->writeVarint($stream, $this->fp);
     }
     if ($this->stamina !== null) {
         $writer->writeVarint($stream, 56);
         $writer->writeVarint($stream, $this->stamina);
     }
     if ($this->max_stamina !== null) {
         $writer->writeVarint($stream, 64);
         $writer->writeVarint($stream, $this->max_stamina);
     }
     if ($this->type !== null) {
         $writer->writeVarint($stream, 72);
         $writer->writeVarint($stream, $this->type->value());
     }
     if ($this->latitude !== null) {
         $writer->writeVarint($stream, 81);
         $writer->writeDouble($stream, $this->latitude);
     }
     if ($this->longitude !== null) {
         $writer->writeVarint($stream, 89);
         $writer->writeDouble($stream, $this->longitude);
     }
     if ($this->description !== null) {
         $writer->writeVarint($stream, 98);
         $writer->writeString($stream, $this->description);
     }
     if ($this->modifiers !== null) {
         foreach ($this->modifiers as $val) {
             $writer->writeVarint($stream, 106);
             $writer->writeVarint($stream, $val->serializedSize($sizeContext));
             $val->writeTo($context);
         }
     }
     if ($this->extensions !== null) {
         $this->extensions->writeTo($context);
     }
     return $stream;
 }
開發者ID:jaspervdm,項目名稱:pogoprotos-php,代碼行數:71,代碼來源:FortDetailsResponse.php

示例5: writeTo

 /**
  * {@inheritdoc}
  */
 public function writeTo(\Protobuf\WriteContext $context)
 {
     $stream = $context->getStream();
     $writer = $context->getWriter();
     $sizeContext = $context->getComputeSizeContext();
     if ($this->result !== null) {
         $writer->writeVarint($stream, 8);
         $writer->writeVarint($stream, $this->result->value());
     }
     if ($this->log_entries !== null) {
         foreach ($this->log_entries as $val) {
             $writer->writeVarint($stream, 18);
             $writer->writeVarint($stream, $val->serializedSize($sizeContext));
             $val->writeTo($context);
         }
     }
     if ($this->extensions !== null) {
         $this->extensions->writeTo($context);
     }
     return $stream;
 }
開發者ID:jaspervdm,項目名稱:pogoprotos-php,代碼行數:24,代碼來源:SfidaActionLogResponse.php

示例6: writeTo

 /**
  * {@inheritdoc}
  */
 public function writeTo(\Protobuf\WriteContext $context)
 {
     $stream = $context->getStream();
     $writer = $context->getWriter();
     $sizeContext = $context->getComputeSizeContext();
     if ($this->fort_id !== null) {
         $writer->writeVarint($stream, 10);
         $writer->writeString($stream, $this->fort_id);
     }
     if ($this->encounter_id !== null) {
         $writer->writeVarint($stream, 17);
         $writer->writeFixed64($stream, $this->encounter_id);
     }
     if ($this->active_pokemon_id !== null) {
         $writer->writeVarint($stream, 24);
         $writer->writeVarint($stream, $this->active_pokemon_id->value());
     }
     if ($this->lure_expires_timestamp_ms !== null) {
         $writer->writeVarint($stream, 32);
         $writer->writeVarint($stream, $this->lure_expires_timestamp_ms);
     }
     if ($this->extensions !== null) {
         $this->extensions->writeTo($context);
     }
     return $stream;
 }
開發者ID:jaspervdm,項目名稱:pogoprotos-php,代碼行數:29,代碼來源:FortLureInfo.php

示例7: writeTo

 /**
  * {@inheritdoc}
  */
 public function writeTo(\Protobuf\WriteContext $context)
 {
     $stream = $context->getStream();
     $writer = $context->getWriter();
     $sizeContext = $context->getComputeSizeContext();
     if ($this->encounter_id !== null) {
         $writer->writeVarint($stream, 9);
         $writer->writeFixed64($stream, $this->encounter_id);
     }
     if ($this->spawn_point_id !== null) {
         $writer->writeVarint($stream, 18);
         $writer->writeString($stream, $this->spawn_point_id);
     }
     if ($this->player_latitude !== null) {
         $writer->writeVarint($stream, 25);
         $writer->writeDouble($stream, $this->player_latitude);
     }
     if ($this->player_longitude !== null) {
         $writer->writeVarint($stream, 33);
         $writer->writeDouble($stream, $this->player_longitude);
     }
     if ($this->extensions !== null) {
         $this->extensions->writeTo($context);
     }
     return $stream;
 }
開發者ID:jaspervdm,項目名稱:pogoprotos-php,代碼行數:29,代碼來源:EncounterMessage.php

示例8: writeTo

 /**
  * {@inheritdoc}
  */
 public function writeTo(\Protobuf\WriteContext $context)
 {
     $stream = $context->getStream();
     $writer = $context->getWriter();
     $sizeContext = $context->getComputeSizeContext();
     if ($this->pokemon_id !== null) {
         $writer->writeVarint($stream, 8);
         $writer->writeVarint($stream, $this->pokemon_id->value());
     }
     if ($this->times_encountered !== null) {
         $writer->writeVarint($stream, 16);
         $writer->writeVarint($stream, $this->times_encountered);
     }
     if ($this->times_captured !== null) {
         $writer->writeVarint($stream, 24);
         $writer->writeVarint($stream, $this->times_captured);
     }
     if ($this->evolution_stone_pieces !== null) {
         $writer->writeVarint($stream, 32);
         $writer->writeVarint($stream, $this->evolution_stone_pieces);
     }
     if ($this->evolution_stones !== null) {
         $writer->writeVarint($stream, 40);
         $writer->writeVarint($stream, $this->evolution_stones);
     }
     if ($this->extensions !== null) {
         $this->extensions->writeTo($context);
     }
     return $stream;
 }
開發者ID:jaspervdm,項目名稱:pogoprotos-php,代碼行數:33,代碼來源:PokedexEntry.php

示例9: writeTo

 /**
  * {@inheritdoc}
  */
 public function writeTo(\Protobuf\WriteContext $context)
 {
     $stream = $context->getStream();
     $writer = $context->getWriter();
     $sizeContext = $context->getComputeSizeContext();
     if ($this->spawn_point_id !== null) {
         $writer->writeVarint($stream, 10);
         $writer->writeString($stream, $this->spawn_point_id);
     }
     if ($this->encounter_id !== null) {
         $writer->writeVarint($stream, 17);
         $writer->writeFixed64($stream, $this->encounter_id);
     }
     if ($this->pokemon_id !== null) {
         $writer->writeVarint($stream, 24);
         $writer->writeVarint($stream, $this->pokemon_id->value());
     }
     if ($this->expiration_timestamp_ms !== null) {
         $writer->writeVarint($stream, 32);
         $writer->writeVarint($stream, $this->expiration_timestamp_ms);
     }
     if ($this->latitude !== null) {
         $writer->writeVarint($stream, 41);
         $writer->writeDouble($stream, $this->latitude);
     }
     if ($this->longitude !== null) {
         $writer->writeVarint($stream, 49);
         $writer->writeDouble($stream, $this->longitude);
     }
     if ($this->extensions !== null) {
         $this->extensions->writeTo($context);
     }
     return $stream;
 }
開發者ID:jaspervdm,項目名稱:pogoprotos-php,代碼行數:37,代碼來源:MapPokemon.php

示例10: writeTo

 /**
  * {@inheritdoc}
  */
 public function writeTo(\Protobuf\WriteContext $context)
 {
     $stream = $context->getStream();
     $writer = $context->getWriter();
     $sizeContext = $context->getComputeSizeContext();
     if ($this->daily_bonus_coins !== null) {
         $writer->writeVarint($stream, 8);
         $writer->writeVarint($stream, $this->daily_bonus_coins);
     }
     if ($this->daily_defender_bonus_per_pokemon !== null) {
         foreach ($this->daily_defender_bonus_per_pokemon as $val) {
             $writer->writeVarint($stream, 16);
             $writer->writeVarint($stream, $val);
         }
     }
     if ($this->daily_defender_bonus_max_defenders !== null) {
         $writer->writeVarint($stream, 24);
         $writer->writeVarint($stream, $this->daily_defender_bonus_max_defenders);
     }
     if ($this->daily_defender_bonus_currency !== null) {
         foreach ($this->daily_defender_bonus_currency as $val) {
             $writer->writeVarint($stream, 34);
             $writer->writeString($stream, $val);
         }
     }
     if ($this->min_time_between_claims_ms !== null) {
         $writer->writeVarint($stream, 40);
         $writer->writeVarint($stream, $this->min_time_between_claims_ms);
     }
     if ($this->daily_bonus_enabled !== null) {
         $writer->writeVarint($stream, 48);
         $writer->writeBool($stream, $this->daily_bonus_enabled);
     }
     if ($this->daily_defender_bonus_enabled !== null) {
         $writer->writeVarint($stream, 56);
         $writer->writeBool($stream, $this->daily_defender_bonus_enabled);
     }
     if ($this->extensions !== null) {
         $this->extensions->writeTo($context);
     }
     return $stream;
 }
開發者ID:jaspervdm,項目名稱:pogoprotos-php,代碼行數:45,代碼來源:IapSettings.php

示例11: writeTo

 /**
  * {@inheritdoc}
  */
 public function writeTo(\Protobuf\WriteContext $context)
 {
     $stream = $context->getStream();
     $writer = $context->getWriter();
     $sizeContext = $context->getComputeSizeContext();
     if ($this->max_pokemon !== null) {
         $writer->writeVarint($stream, 8);
         $writer->writeVarint($stream, $this->max_pokemon);
     }
     if ($this->max_bag_items !== null) {
         $writer->writeVarint($stream, 16);
         $writer->writeVarint($stream, $this->max_bag_items);
     }
     if ($this->base_pokemon !== null) {
         $writer->writeVarint($stream, 24);
         $writer->writeVarint($stream, $this->base_pokemon);
     }
     if ($this->base_bag_items !== null) {
         $writer->writeVarint($stream, 32);
         $writer->writeVarint($stream, $this->base_bag_items);
     }
     if ($this->base_eggs !== null) {
         $writer->writeVarint($stream, 40);
         $writer->writeVarint($stream, $this->base_eggs);
     }
     if ($this->extensions !== null) {
         $this->extensions->writeTo($context);
     }
     return $stream;
 }
開發者ID:jaspervdm,項目名稱:pogoprotos-php,代碼行數:33,代碼來源:InventorySettings.php

示例12: writeTo

 /**
  * {@inheritdoc}
  */
 public function writeTo(\Protobuf\WriteContext $context)
 {
     $stream = $context->getStream();
     $writer = $context->getWriter();
     $sizeContext = $context->getComputeSizeContext();
     if ($this->name_part === null) {
         throw new \UnexpectedValueException('Field "\\google\\protobuf\\UninterpretedOption\\NamePart#name_part" (tag 1) is required but has no value.');
     }
     if ($this->is_extension === null) {
         throw new \UnexpectedValueException('Field "\\google\\protobuf\\UninterpretedOption\\NamePart#is_extension" (tag 2) is required but has no value.');
     }
     if ($this->name_part !== null) {
         $writer->writeVarint($stream, 10);
         $writer->writeString($stream, $this->name_part);
     }
     if ($this->is_extension !== null) {
         $writer->writeVarint($stream, 16);
         $writer->writeBool($stream, $this->is_extension);
     }
     if ($this->extensions !== null) {
         $this->extensions->writeTo($context);
     }
     return $stream;
 }
開發者ID:protobuf-php,項目名稱:google-protobuf-proto,代碼行數:27,代碼來源:NamePart.php

示例13: writeTo

 /**
  * {@inheritdoc}
  */
 public function writeTo(\Protobuf\WriteContext $context)
 {
     $stream = $context->getStream();
     $writer = $context->getWriter();
     $sizeContext = $context->getComputeSizeContext();
     if ($this->active_pokemon !== null) {
         $writer->writeVarint($stream, 10);
         $writer->writeVarint($stream, $this->active_pokemon->serializedSize($sizeContext));
         $this->active_pokemon->writeTo($context);
     }
     if ($this->trainer_public_profile !== null) {
         $writer->writeVarint($stream, 18);
         $writer->writeVarint($stream, $this->trainer_public_profile->serializedSize($sizeContext));
         $this->trainer_public_profile->writeTo($context);
     }
     if ($this->reverse_pokemon !== null) {
         foreach ($this->reverse_pokemon as $val) {
             $writer->writeVarint($stream, 26);
             $writer->writeVarint($stream, $val->serializedSize($sizeContext));
             $val->writeTo($context);
         }
     }
     if ($this->defeated_pokemon !== null) {
         foreach ($this->defeated_pokemon as $val) {
             $writer->writeVarint($stream, 34);
             $writer->writeVarint($stream, $val->serializedSize($sizeContext));
             $val->writeTo($context);
         }
     }
     if ($this->extensions !== null) {
         $this->extensions->writeTo($context);
     }
     return $stream;
 }
開發者ID:jaspervdm,項目名稱:pogoprotos-php,代碼行數:37,代碼來源:BattleParticipant.php

示例14: writeTo

 /**
  * {@inheritdoc}
  */
 public function writeTo(\Protobuf\WriteContext $context)
 {
     $stream = $context->getStream();
     $writer = $context->getWriter();
     $sizeContext = $context->getComputeSizeContext();
     if ($this->name !== null) {
         $writer->writeVarint($stream, 10);
         $writer->writeString($stream, $this->name);
     }
     if ($this->number !== null) {
         $writer->writeVarint($stream, 16);
         $writer->writeVarint($stream, $this->number);
     }
     if ($this->options !== null) {
         $writer->writeVarint($stream, 26);
         $writer->writeVarint($stream, $this->options->serializedSize($sizeContext));
         $this->options->writeTo($context);
     }
     if ($this->extensions !== null) {
         $this->extensions->writeTo($context);
     }
     return $stream;
 }
開發者ID:protobuf-php,項目名稱:google-protobuf-proto,代碼行數:26,代碼來源:EnumValueDescriptorProto.php

示例15: writeTo

 /**
  * {@inheritdoc}
  */
 public function writeTo(\Protobuf\WriteContext $context)
 {
     $stream = $context->getStream();
     $writer = $context->getWriter();
     $sizeContext = $context->getComputeSizeContext();
     if ($this->contact_settings !== null) {
         $writer->writeVarint($stream, 10);
         $writer->writeVarint($stream, $this->contact_settings->serializedSize($sizeContext));
         $this->contact_settings->writeTo($context);
     }
     if ($this->extensions !== null) {
         $this->extensions->writeTo($context);
     }
     return $stream;
 }
開發者ID:jaspervdm,項目名稱:pogoprotos-php,代碼行數:18,代碼來源:SetContactSettingsMessage.php


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