From 1eee94d2604fb43b5a4a21c281c72ad356906a88 Mon Sep 17 00:00:00 2001 From: Fbenas Date: Sun, 12 Mar 2017 23:57:42 +0000 Subject: Added identify form and Ratchet websockets test stuff --- src/Game.php | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) (limited to 'src/Game.php') diff --git a/src/Game.php b/src/Game.php index c50bd34..170a8eb 100644 --- a/src/Game.php +++ b/src/Game.php @@ -11,14 +11,16 @@ use App\Message\Handler; */ class Game { + protected $code; + /** * Constuct a new Game * * @author Phil Burton */ - public function __construct() + public function __construct($name, $code) { - $this->init(); + $this->init($name, $code); } /** @@ -26,23 +28,20 @@ class Game * * @author Phil Burton */ - protected function init() + protected function init($name, $code) { // Do any pre set-up - $this->handler = new Handler(['inject']); - $this->sendOpeningMessage(); - } + $this->code = $code; - /** - * Send opening message - * @author Phil Burton - */ - public function sendOpeningMessage() - { - $message = $this->handler->renderOverview(); + $handler = new Handler(['gameCode', 'name']); + $handler->gameCode = $code; + $handler->name = $name; - $important = $this->handler->returnImportant('inject'); + $this->handler = $handler; + } - var_dump($message, $important); + public function getHandler() + { + return $this->handler; } } -- cgit v1.2.3