/** * @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) }
/** * @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 }
/** * {@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; }
/** * @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()); }
function __construct(PokemonGoAPI $pokemonGoAPI, FortData $fortData) { $this->pokemonGoAPI = $pokemonGoAPI; $this->fortData = $fortData; $this->cooldownCompleteTimestampMs = $fortData->getCooldownCompleteTimestampMs(); }