src/GameOfLife/Outputs/JpgOutput.php
/**
     * Outputs one game step.
     *
     * @param Board $_board Current board
     * @param Bool $_isFinalBoard Indicates whether the simulation ends after this output
     */
Outputs one game step.
@param Board $_board Current board
@param Bool $_isFinalBoard Indicates whether the simulation ends after this output
Outputs one game step . @param Board $_board Current board @param Bool $_isFinalBoard Indicates whether the simulation ends after this output
public function outputBoard(Board $_board, Bool $_isFinalBoard)
    {
        echo "\rGamestep: " . ($_board->gameStep() + 1);
        $image = $this->imageCreator->createImage($_board);
        $fileName = $_board->gameStep() . ".jpg";
        $filePath = $this->imageOutputDirectory . "/" . $fileName;
        imagejpeg($image, $filePath);
        unset($image);
    }
public function outputBoard ( Board $ _board , Bool $ _isFinalBoard ) { echo " \r Gamestep:  " . ( $ _board -> gameStep ( ) + 1 ) ; $ image = $ this -> imageCreator -> createImage ( $ _board ) ; $ fileName = $ _board -> gameStep ( ) . " .jpg " ; $ filePath = $ this -> imageOutputDirectory . " / " . $ fileName ; imagejpeg ( $ image , $ filePath ) ; unset ( $ image ) ; }
Outputs one game step.
Outputs one game step .