예제 #1
0
파일: Fleet.php 프로젝트: nemesismax/OGetIt
 /**
  * @param Technology $technology
  * @param integer $count
  * @param integer $lost
  */
 public function addTechnologyState($technology, $count, $lost = false)
 {
     if (isset($this->_state[$technology->getType()])) {
         $this->_state[$technology->getType()]->addCount($count);
         if ($lost !== false) {
             $this->_state[$technology->getType()]->addLost($lost);
         }
     } else {
         $techState = new StateCombatWithLosses($technology, $count, $lost);
         $this->_state[$technology->getType()] = $techState;
     }
 }
예제 #2
0
 /**
  * @param integer $type
  * @param integer $metal
  * @param integer $crystal
  * @param integer $deuterium
  */
 protected function __construct($type, $metal, $crystal, $deuterium, $armor, $shield, $weapon)
 {
     parent::__construct($type, $metal, $crystal, $deuterium);
     $this->ARMOR = $armor;
     $this->SHIELD = $shield;
     $this->WEAPON = $weapon;
 }
예제 #3
0
 public function jsonSerialize()
 {
     return array_merge(array('armour' => $this->ARMOR, 'shield' => $this->SHIELD, 'weapon' => $this->WEAPON, 'rapidfire_from' => static::$RAPIDFIRE_FROM, 'rapidfire_against' => static::$RAPIDFIRE_AGAINST), parent::jsonSerialize());
 }
예제 #4
0
 public function jsonSerialize()
 {
     return array_merge(array('power_base' => $this->power_base), parent::jsonSerialize());
 }
예제 #5
0
 /**
  * @param integer $type
  * @param integer $metal
  * @param integer $crystal
  * @param integer $deuterium
  * @param integer $energy
  */
 protected function __construct($type, $metal, $crystal, $deuterium, $energy = 0)
 {
     parent::__construct($type, $metal, $crystal, $deuterium, $energy);
 }