src/GameOfLife/Inputs/BoardEditor/Options/InvertBoardOption.php
/**
     * Inverts the fields inside the selection.
     *
     * @param array $_selectionCoordinates The selection coordinates
     */
Inverts the fields inside the selection.
@param array $_selectionCoordinates The selection coordinates
Inverts the fields inside the selection . @param array $_selectionCoordinates The selection coordinates
private function invertSelection(array $_selectionCoordinates)
    {
        for ($y = $_selectionCoordinates["A"]["y"]; $y <= $_selectionCoordinates["B"]["y"]; $y++)
        {
            for ($x = $_selectionCoordinates["A"]["x"]; $x <= $_selectionCoordinates["B"]["x"]; $x++)
            {
                $field = $this->parentBoardEditor->board()->fields()[$y][$x];
                $field->setValue(! $field->value());
            }
        }
    }
private function invertSelection ( array $ _selectionCoordinates ) { for ( $ y = $ _selectionCoordinates [ " A " ] [ " y " ] ; $ y <= $ _selectionCoordinates [ " B " ] [ " y " ] ; $ y ++ ) { for ( $ x = $ _selectionCoordinates [ " A " ] [ " x " ] ; $ x <= $ _selectionCoordinates [ " B " ] [ " x " ] ; $ x ++ ) { $ field = $ this -> parentBoardEditor -> board ( ) -> fields ( ) [ $ y ] [ $ x ] ; $ field -> setValue ( ! $ field -> value ( ) ) ; } } }
Inverts the fields inside the selection.
Inverts the fields inside the selection .
/** @var Field $field */