/**
  * {@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->battle_start_timestamp_ms !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->battle_start_timestamp_ms);
     }
     if ($this->battle_end_timestamp_ms !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->battle_end_timestamp_ms);
     }
     if ($this->battle_id !== null) {
         $size += 1;
         $size += $calculator->computeStringSize($this->battle_id);
     }
     if ($this->defender !== null) {
         $innerSize = $this->defender->serializedSize($context);
         $size += 1;
         $size += $innerSize;
         $size += $calculator->computeVarintSize($innerSize);
     }
     if ($this->battle_log !== null) {
         $innerSize = $this->battle_log->serializedSize($context);
         $size += 1;
         $size += $innerSize;
         $size += $calculator->computeVarintSize($innerSize);
     }
     if ($this->attacker !== null) {
         $innerSize = $this->attacker->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->type !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->type->value());
     }
     if ($this->action_start_ms !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->action_start_ms);
     }
     if ($this->duration_ms !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->duration_ms);
     }
     if ($this->energy_delta !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->energy_delta);
     }
     if ($this->attacker_index !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->attacker_index);
     }
     if ($this->target_index !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->target_index);
     }
     if ($this->active_pokemon_id !== null) {
         $size += 1;
         $size += 8;
     }
     if ($this->player_joined !== null) {
         $innerSize = $this->player_joined->serializedSize($context);
         $size += 1;
         $size += $innerSize;
         $size += $calculator->computeVarintSize($innerSize);
     }
     if ($this->battle_results !== null) {
         $innerSize = $this->battle_results->serializedSize($context);
         $size += 1;
         $size += $innerSize;
         $size += $calculator->computeVarintSize($innerSize);
     }
     if ($this->damage_windows_start_timestamp_ms !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->damage_windows_start_timestamp_ms);
     }
     if ($this->damage_windows_end_timestamp_ms !== null) {
         $size += 1;
         $size += $calculator->computeVarintSize($this->damage_windows_end_timestamp_ms);
     }
     if ($this->player_left !== null) {
         $innerSize = $this->player_left->serializedSize($context);
         $size += 1;
         $size += $innerSize;
         $size += $calculator->computeVarintSize($innerSize);
     }
     if ($this->target_pokemon_id !== null) {
         $size += 1;
         $size += 8;
     }
     if ($this->extensions !== null) {
         $size += $this->extensions->serializedSize($context);
     }
     return $size;
 }