public function addBattlefield(Battlefield $battlefield) : self { $this->battlefields[] = $battlefield; if (PlayerModel::isAIControlled($battlefield->getPlayer())) { foreach ($battlefield->getCells() as $cell) { $cell->setFlags(CellModel::FLAG_NONE); } } return $this; }
/** * @param Battlefield $battlefield * @param Cell $cell - this cell will be attacked if attacker is human * * @return Cell */ protected function processPlayerTurn(Battlefield $battlefield, Cell $cell) : Cell { return PlayerModel::isAIControlled($battlefield->getPlayer()) ? CellModel::switchPhase($cell) : $this->ai->processCPUTurn($battlefield); }