src/GameOfLife/Outputs/GifOutput.php
/**
     * Creates a single Gif file for the current game step.
     *
     * @param Board $_board The board which will be output
     * @param Bool $_isFinalBoard Indicates whether the simulation ends after this output
     */
Creates a single Gif file for the current game step.
@param Board $_board The board which will be output
@param Bool $_isFinalBoard Indicates whether the simulation ends after this output
Creates a single Gif file for the current game step . @param Board $_board The board which will be output @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() . ".gif";
        $filePath = $this->imageOutputDirectory . "/" . $fileName;
        imagegif($image, $filePath);
        unset($image);
        $this->frames[] = $filePath;
    }
public function outputBoard ( Board $ _board , Bool $ _isFinalBoard ) { echo " \r Gamestep:  " . ( $ _board -> gameStep ( ) + 1 ) ; $ image = $ this -> imageCreator -> createImage ( $ _board ) ; $ fileName = $ _board -> gameStep ( ) . " .gif " ; $ filePath = $ this -> imageOutputDirectory . " / " . $ fileName ; imagegif ( $ image , $ filePath ) ; unset ( $ image ) ; $ this -> frames [ ] = $ filePath ; }
Creates a single Gif file for the current game step.
Creates a single Gif file for the current game step .