/** * Add cell only on free and exist cell * * @param Cell $cell */ public function addCell(Cell $cell) { if (!isset($this->kitCells[$cell->getPosition()])) { ExceptionFactory::positionOutOfRangeException($cell->getPosition()); } if (!empty($this->kitCells[$cell->getPosition()])) { ExceptionFactory::positionAlreadyExistException($cell->getPosition()); } $this->kitCells[$cell->getPosition()] = $cell; }