src/GameOfLife/Inputs/TemplateInput.php
/**
     * Adds TemplateInputs options to a Getopt object.
     *
     * @param Getopt $_options The option list to which the objects options are added
     */
Adds TemplateInputs options to a Getopt object.
@param Getopt $_options The option list to which the objects options are added
Adds TemplateInputs options to a Getopt object . @param Getopt $_options The option list to which the objects options are added
public function addOptions(Getopt $_options)
    {
        foreach ($this->defaultTemplateNames as $defaultTemplateName)
        {
            $_options->addOptions(
                array (
                    array(null, $defaultTemplateName . "PosX", Getopt::REQUIRED_ARGUMENT, "TemplateInput - X position of the " . $defaultTemplateName),
                    array(null, $defaultTemplateName . "PosY", Getopt::REQUIRED_ARGUMENT, "TemplateInput - Y position of the " . $defaultTemplateName . "\n")
                )
            );
        }
        $_options->addOptions(
            array
            (
                array(null, "template", Getopt::REQUIRED_ARGUMENT, "TemplateInput - The name of the template file that shall be loaded"),
                array(null, "list-templates", Getopt::NO_ARGUMENT, "TemplateInput - Display a list of all templates"),
                array(null, "templatePosX", Getopt::REQUIRED_ARGUMENT, "TemplateInput - X-Position of the top left corner of the template"),
                array(null, "templatePosY", Getopt::REQUIRED_ARGUMENT, "TemplateInput - Y-Position of the top left corner of the template"),
                array(null, "invertTemplate", Getopt::NO_ARGUMENT, "TemplateInput - Inverts the loaded template\n")
            )
        );
    }
public function addOptions ( Getopt $ _options ) { foreach ( $ this -> defaultTemplateNames as $ defaultTemplateName ) { $ _options -> addOptions ( array ( array ( null , $ defaultTemplateName . " PosX " , Getopt :: REQUIRED_ARGUMENT , " TemplateInput - X position of the  " . $ defaultTemplateName ) , array ( null , $ defaultTemplateName . " PosY " , Getopt :: REQUIRED_ARGUMENT , " TemplateInput - Y position of the  " . $ defaultTemplateName . " \n " ) ) ) ; } $ _options -> addOptions ( array ( array ( null , " template " , Getopt :: REQUIRED_ARGUMENT , " TemplateInput - The name of the template file that shall be loaded " ) , array ( null , " list-templates " , Getopt :: NO_ARGUMENT , " TemplateInput - Display a list of all templates " ) , array ( null , " templatePosX " , Getopt :: REQUIRED_ARGUMENT , " TemplateInput - X-Position of the top left corner of the template " ) , array ( null , " templatePosY " , Getopt :: REQUIRED_ARGUMENT , " TemplateInput - Y-Position of the top left corner of the template " ) , array ( null , " invertTemplate " , Getopt :: NO_ARGUMENT , " TemplateInput - Inverts the loaded template \n " ) ) ) ; }
Adds TemplateInputs options to a Getopt object.
Adds TemplateInputs options to a Getopt object .
// Generate the options for the default templates