diff options
Diffstat (limited to 'src/Game.php')
-rw-r--r-- | src/Game.php | 29 |
1 files changed, 14 insertions, 15 deletions
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 <phil@pgburton.com> */ - public function __construct() + public function __construct($name, $code) { - $this->init(); + $this->init($name, $code); } /** @@ -26,23 +28,20 @@ class Game * * @author Phil Burton <phil@pgburton.com> */ - 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 <phil@pgburton.com> - */ - 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; } } |