src/GameOfLife/Inputs/BoardEditor/Options/DeleteSelectionOption.php
/**
     * Unsets the fields in the current selection area.
     *
     * @return bool Indicates whether the board editing is finished
     *
     * @throws \Exception The exception when the selection coordinates are empty
     */
Unsets the fields in the current selection area.
@return bool Indicates whether the board editing is finished

@throws \Exception The exception when the selection coordinates are empty
Unsets the fields in the current selection area . @return bool Indicates whether the board editing is finished @throws \ Exception The exception when the selection coordinates are empty
public function deleteSelection(): Bool
    {
        $selectionCoordinates = $this->parentBoardEditor->selectionCoordinates();
        if ($selectionCoordinates == array()) throw new \Exception("There are no fields selected at the moment.");
        for ($y = $selectionCoordinates["A"]["y"]; $y <= $selectionCoordinates["B"]["y"]; $y++)
        {
            for ($x = $selectionCoordinates["A"]["x"]; $x <= $selectionCoordinates["B"]["x"]; $x++)
            {
                $this->parentBoardEditor->board()->setField($x, $y, false);
            }
        }
        $this->parentBoardEditor->outputBoard();
        return false;
    }
public function deleteSelection ( ) : Bool { $ selectionCoordinates = $ this -> parentBoardEditor -> selectionCoordinates ( ) ; if ( $ selectionCoordinates == array ( ) ) throw new \ Exception ( " There are no fields selected at the moment. " ) ; for ( $ y = $ selectionCoordinates [ " A " ] [ " y " ] ; $ y <= $ selectionCoordinates [ " B " ] [ " y " ] ; $ y ++ ) { for ( $ x = $ selectionCoordinates [ " A " ] [ " x " ] ; $ x <= $ selectionCoordinates [ " B " ] [ " x " ] ; $ x ++ ) { $ this -> parentBoardEditor -> board ( ) -> setField ( $ x , $ y , false ) ; } } $ this -> parentBoardEditor -> outputBoard ( ) ; return false ; }
Unsets the fields in the current selection area.
Unsets the fields in the current selection area .