Ejemplo n.º 1
0
 /**
  * @param Session $session
  * @param FortData $data
  */
 public function __construct(Session $session, FortData $data)
 {
     if ($data->getType() != FortType::CHECKPOINT()) {
         throw new InvalidArgumentException("Fort not a pokestop");
     }
     parent::__construct($session, $data);
     // TODO: modifier
     // TODO: lure
     // TODO: sponsor (maybe)
 }
Ejemplo n.º 2
0
 /**
  * @param Session $session
  * @param FortData $data
  */
 public function __construct(Session $session, FortData $data)
 {
     if (!is_null($data->getType()) && $data->getType() != FortType::GYM()) {
         throw new InvalidArgumentException("Fort not a gym");
     }
     parent::__construct($session, $data);
     // TODO: team color
     // TODO: highest cp pokemon
     // TODO: xp
     // TODO: in battle
 }
Ejemplo n.º 3
0
 /**
  * {@inheritdoc}
  */
 public function serializedSize(\Protobuf\ComputeSizeContext $context)
 {
     $calculator = $context->getSizeCalculator();
     $size = 0;
     if ($this->fort_data !== null) {
         $innerSize = $this->fort_data->serializedSize($context);
         $size += 1;
         $size += $innerSize;
         $size += $calculator->computeVarintSize($innerSize);
     }
     if ($this->memberships !== null) {
         foreach ($this->memberships as $val) {
             $innerSize = $val->serializedSize($context);
             $size += 1;
             $size += $innerSize;
             $size += $calculator->computeVarintSize($innerSize);
         }
     }
     if ($this->deploy_lockout !== null) {
         $size += 1;
         $size += 1;
     }
     if ($this->extensions !== null) {
         $size += $this->extensions->serializedSize($context);
     }
     return $size;
 }
Ejemplo n.º 4
0
 /**
  * @param Session $session
  * @param FortData $data
  */
 public function __construct(Session $session, FortData $data)
 {
     $this->session = $session;
     $this->id = $data->getId();
     $this->location = new Location($data->getLatitude(), $data->getLongitude());
 }
Ejemplo n.º 5
0
 function __construct(PokemonGoAPI $pokemonGoAPI, FortData $fortData)
 {
     $this->pokemonGoAPI = $pokemonGoAPI;
     $this->fortData = $fortData;
     $this->cooldownCompleteTimestampMs = $fortData->getCooldownCompleteTimestampMs();
 }