Exemplo n.º 1
0
 public function jsonSerialize()
 {
     return array_merge(array('planet' => $this->planet, 'combat_index' => $this->combat_index), parent::jsonSerialize());
 }
Exemplo n.º 2
0
 /**
  * @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;
 }
Exemplo n.º 3
0
 /**
  * @return Fleet
  */
 public function getFleetsMerged()
 {
     $merged = new Fleet();
     foreach ($this->fleets as $fleet) {
         $merged->merge($fleet);
     }
     return $merged;
 }