public function jsonSerialize() { return array_merge(array('planet' => $this->planet, 'combat_index' => $this->combat_index), parent::jsonSerialize()); }
/** * @param Fleet $other * @return Fleet */ public function difference(Fleet $other) { $fleet = clone $other; foreach ($this->_state as $type => $techState) { $count = $other->getTechnologyState($type) !== null ? $other->getTechnologyState($type)->getCount() : 0; $lost = $techState->getCount() - $count; $fleet->addTechnologyState($techState->getTechnology(), $count, $lost); } return $fleet; }
/** * @return Fleet */ public function getFleetsMerged() { $merged = new Fleet(); foreach ($this->fleets as $fleet) { $merged->merge($fleet); } return $merged; }