private $robotName = [];
private $arrayRobot = [];
public function addType($robotParam)
{
$this->robotName = $robotParam;
}
private function createNewRobots($countRobots, $robotType)
{
$this->arrayRobot = [];
for($i = 0; $i < $countRobots; $i++)
$this->arrayRobot[$i] = clone $robotType;
$this->robotName = [];
return $this->arrayRobot;
}
$factory->addType(new Robot1());
$factory->addType(new Robot2());
И
?