本文整理汇总了PHP中Protobuf\Extension\ExtensionFieldMap::writeTo方法的典型用法代码示例。如果您正苦于以下问题:PHP ExtensionFieldMap::writeTo方法的具体用法?PHP ExtensionFieldMap::writeTo怎么用?PHP ExtensionFieldMap::writeTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Protobuf\Extension\ExtensionFieldMap
的用法示例。
在下文中一共展示了ExtensionFieldMap::writeTo方法的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;
}
示例2: writeTo
/**
* {@inheritdoc}
*/
public function writeTo(\Protobuf\WriteContext $context)
{
$stream = $context->getStream();
$writer = $context->getWriter();
$sizeContext = $context->getComputeSizeContext();
if ($this->platform !== null) {
$writer->writeVarint($stream, 8);
$writer->writeVarint($stream, $this->platform->value());
}
if ($this->device_manufacturer !== null) {
$writer->writeVarint($stream, 18);
$writer->writeString($stream, $this->device_manufacturer);
}
if ($this->device_model !== null) {
$writer->writeVarint($stream, 26);
$writer->writeString($stream, $this->device_model);
}
if ($this->locale !== null) {
$writer->writeVarint($stream, 34);
$writer->writeString($stream, $this->locale);
}
if ($this->app_version !== null) {
$writer->writeVarint($stream, 40);
$writer->writeVarint($stream, $this->app_version);
}
if ($this->extensions !== null) {
$this->extensions->writeTo($context);
}
return $stream;
}
示例3: writeTo
/**
* {@inheritdoc}
*/
public function writeTo(\Protobuf\WriteContext $context)
{
$stream = $context->getStream();
$writer = $context->getWriter();
$sizeContext = $context->getComputeSizeContext();
if ($this->success !== null) {
$writer->writeVarint($stream, 8);
$writer->writeBool($stream, $this->success);
}
if ($this->awarded_badges !== null) {
foreach ($this->awarded_badges as $val) {
$writer->writeVarint($stream, 16);
$writer->writeVarint($stream, $val->value());
}
}
if ($this->awarded_badge_levels !== null) {
foreach ($this->awarded_badge_levels as $val) {
$writer->writeVarint($stream, 24);
$writer->writeVarint($stream, $val);
}
}
if ($this->extensions !== null) {
$this->extensions->writeTo($context);
}
return $stream;
}
示例4: 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;
}
示例5: 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;
}
示例6: 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;
}
示例7: 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->pokemon_id !== null) {
$writer->writeVarint($stream, 16);
$writer->writeVarint($stream, $this->pokemon_id->value());
}
if ($this->combat_points !== null) {
$writer->writeVarint($stream, 24);
$writer->writeVarint($stream, $this->combat_points);
}
if ($this->pokemon_data_id !== null) {
$writer->writeVarint($stream, 33);
$writer->writeFixed64($stream, $this->pokemon_data_id);
}
if ($this->extensions !== null) {
$this->extensions->writeTo($context);
}
return $stream;
}
示例8: 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->start_time !== null) {
$writer->writeVarint($stream, 16);
$writer->writeVarint($stream, $this->start_time);
}
if ($this->badges !== null) {
foreach ($this->badges as $val) {
$writer->writeVarint($stream, 26);
$writer->writeVarint($stream, $val->serializedSize($sizeContext));
$val->writeTo($context);
}
}
if ($this->extensions !== null) {
$this->extensions->writeTo($context);
}
return $stream;
}
示例9: 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->distance_in_meters !== null) {
$writer->writeVarint($stream, 21);
$writer->writeFloat($stream, $this->distance_in_meters);
}
if ($this->encounter_id !== null) {
$writer->writeVarint($stream, 25);
$writer->writeFixed64($stream, $this->encounter_id);
}
if ($this->fort_id !== null) {
$writer->writeVarint($stream, 34);
$writer->writeString($stream, $this->fort_id);
}
if ($this->fort_image_url !== null) {
$writer->writeVarint($stream, 42);
$writer->writeString($stream, $this->fort_image_url);
}
if ($this->extensions !== null) {
$this->extensions->writeTo($context);
}
return $stream;
}
示例10: writeTo
/**
* {@inheritdoc}
*/
public function writeTo(\Protobuf\WriteContext $context)
{
$stream = $context->getStream();
$writer = $context->getWriter();
$sizeContext = $context->getComputeSizeContext();
if ($this->codename !== null) {
$writer->writeVarint($stream, 10);
$writer->writeString($stream, $this->codename);
}
if ($this->user_message !== null) {
$writer->writeVarint($stream, 18);
$writer->writeString($stream, $this->user_message);
}
if ($this->is_assignable !== null) {
$writer->writeVarint($stream, 24);
$writer->writeBool($stream, $this->is_assignable);
}
if ($this->status !== null) {
$writer->writeVarint($stream, 32);
$writer->writeVarint($stream, $this->status->value());
}
if ($this->extensions !== null) {
$this->extensions->writeTo($context);
}
return $stream;
}
示例11: writeTo
/**
* {@inheritdoc}
*/
public function writeTo(\Protobuf\WriteContext $context)
{
$stream = $context->getStream();
$writer = $context->getWriter();
$sizeContext = $context->getComputeSizeContext();
if ($this->interaction_range_meters !== null) {
$writer->writeVarint($stream, 9);
$writer->writeDouble($stream, $this->interaction_range_meters);
}
if ($this->max_total_deployed_pokemon !== null) {
$writer->writeVarint($stream, 16);
$writer->writeVarint($stream, $this->max_total_deployed_pokemon);
}
if ($this->max_player_deployed_pokemon !== null) {
$writer->writeVarint($stream, 24);
$writer->writeVarint($stream, $this->max_player_deployed_pokemon);
}
if ($this->deploy_stamina_multiplier !== null) {
$writer->writeVarint($stream, 33);
$writer->writeDouble($stream, $this->deploy_stamina_multiplier);
}
if ($this->deploy_attack_multiplier !== null) {
$writer->writeVarint($stream, 41);
$writer->writeDouble($stream, $this->deploy_attack_multiplier);
}
if ($this->far_interaction_range_meters !== null) {
$writer->writeVarint($stream, 49);
$writer->writeDouble($stream, $this->far_interaction_range_meters);
}
if ($this->extensions !== null) {
$this->extensions->writeTo($context);
}
return $stream;
}
示例12: writeTo
/**
* {@inheritdoc}
*/
public function writeTo(\Protobuf\WriteContext $context)
{
$stream = $context->getStream();
$writer = $context->getWriter();
$sizeContext = $context->getComputeSizeContext();
if ($this->disk_radius_m !== null) {
$writer->writeVarint($stream, 13);
$writer->writeFloat($stream, $this->disk_radius_m);
}
if ($this->cylinder_radius_m !== null) {
$writer->writeVarint($stream, 21);
$writer->writeFloat($stream, $this->cylinder_radius_m);
}
if ($this->cylinder_height_m !== null) {
$writer->writeVarint($stream, 29);
$writer->writeFloat($stream, $this->cylinder_height_m);
}
if ($this->cylinder_ground_m !== null) {
$writer->writeVarint($stream, 37);
$writer->writeFloat($stream, $this->cylinder_ground_m);
}
if ($this->shoulder_mode_scale !== null) {
$writer->writeVarint($stream, 45);
$writer->writeFloat($stream, $this->shoulder_mode_scale);
}
if ($this->extensions !== null) {
$this->extensions->writeTo($context);
}
return $stream;
}
示例13: 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->value !== null) {
foreach ($this->value as $val) {
$writer->writeVarint($stream, 18);
$writer->writeVarint($stream, $val->serializedSize($sizeContext));
$val->writeTo($context);
}
}
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;
}
示例14: writeTo
/**
* {@inheritdoc}
*/
public function writeTo(\Protobuf\WriteContext $context)
{
$stream = $context->getStream();
$writer = $context->getWriter();
$sizeContext = $context->getComputeSizeContext();
if ($this->equip_badge_cooldown_ms !== null) {
$writer->writeVarint($stream, 8);
$writer->writeVarint($stream, $this->equip_badge_cooldown_ms);
}
if ($this->catch_probability_bonus !== null) {
foreach ($this->catch_probability_bonus as $val) {
$writer->writeVarint($stream, 21);
$writer->writeFloat($stream, $val);
}
}
if ($this->flee_probability_bonus !== null) {
foreach ($this->flee_probability_bonus as $val) {
$writer->writeVarint($stream, 29);
$writer->writeFloat($stream, $val);
}
}
if ($this->extensions !== null) {
$this->extensions->writeTo($context);
}
return $stream;
}
示例15: writeTo
/**
* {@inheritdoc}
*/
public function writeTo(\Protobuf\WriteContext $context)
{
$stream = $context->getStream();
$writer = $context->getWriter();
$sizeContext = $context->getComputeSizeContext();
if ($this->gym_state !== null) {
$writer->writeVarint($stream, 10);
$writer->writeVarint($stream, $this->gym_state->serializedSize($sizeContext));
$this->gym_state->writeTo($context);
}
if ($this->name !== null) {
$writer->writeVarint($stream, 18);
$writer->writeString($stream, $this->name);
}
if ($this->urls !== null) {
foreach ($this->urls as $val) {
$writer->writeVarint($stream, 26);
$writer->writeString($stream, $val);
}
}
if ($this->result !== null) {
$writer->writeVarint($stream, 32);
$writer->writeVarint($stream, $this->result->value());
}
if ($this->description !== null) {
$writer->writeVarint($stream, 42);
$writer->writeString($stream, $this->description);
}
if ($this->extensions !== null) {
$this->extensions->writeTo($context);
}
return $stream;
}