Exemplo n.º 1
0
 /**
  * @param GameObject $gameObject
  */
 public function update($gameObject)
 {
     $oldData = $this->read($gameObject->getId());
     $this->players_id = $gameObject->getPlayersId() !== null ? parent::cleanData($gameObject->getPlayersId()) : $oldData->getPlayersId();
     $this->position = $gameObject->getPosition() !== null ? parent::cleanData($gameObject->getPosition()) : $oldData->getPosition();
     $this->at_bats = $gameObject->getAtBats() !== null ? parent::cleanData($gameObject->getAtBats()) : $oldData->getAtBats();
     $this->runs = $gameObject->getRuns() !== null ? parent::cleanData($gameObject->getRuns()) : $oldData->getRuns();
     $this->hits = $gameObject->getHits() !== null ? parent::cleanData($gameObject->getHits()) : $oldData->getHits();
     $this->doubles = $gameObject->getDoubles() !== null ? parent::cleanData($gameObject->getDoubles()) : $oldData->getDoubles();
     $this->triples = $gameObject->getTriples() !== null ? parent::cleanData($gameObject->getTriples()) : $oldData->getTriples();
     $this->home_runs = $gameObject->getHomeRuns() !== null ? parent::cleanData($gameObject->getHomeRuns()) : $oldData->getHomeRuns();
     $this->rbi = $gameObject->getRbi() !== null ? parent::cleanData($gameObject->getRbi()) : $oldData->getRbi();
     $this->walks = $gameObject->getWalks() !== null ? parent::cleanData($gameObject->getWalks()) : $oldData->getWalks();
     $this->sac_fly = $gameObject->getSacFly() !== null ? parent::cleanData($gameObject->getSacFly()) : $oldData->getSacFly();
 }
Exemplo n.º 2
0
 function __construct($id, $x, $y, $name)
 {
     parent::__construct($id, $x, $y);
     $this->setName($name);
 }