/** * @param $char * @return \Nonogram\Cell\CellBox|\Nonogram\Cell\CellEmpty */ protected function convertRawToCell($char) { $this->cellFactory->setStatusHidden(false); if ($this->getBoxChar() === $char) { $cell = $this->cellFactory->getBox(); } else { $cell = $this->cellFactory->getEmpty(); } return $cell; }
protected function convertRowRawToActual($rowString) { $field = array(); for ($i = 0; $i < strlen($rowString); $i++) { switch ($rowString[$i]) { case 'U': $cell = $this->cellFactory->getUnknown(); break; case 'B': $cell = $this->cellFactory->getBox(); break; case 'E': $cell = $this->cellFactory->getEmpty(); break; } $field[] = $cell; } return $field; }