summaryrefslogtreecommitdiff
path: root/src/Game.php
diff options
context:
space:
mode:
authorFbenas <philbeansburton@gmail.com>2017-03-12 23:57:42 +0000
committerFbenas <philbeansburton@gmail.com>2017-03-12 23:57:42 +0000
commit1eee94d2604fb43b5a4a21c281c72ad356906a88 (patch)
tree23c095b5db60c48dae443356392f5a5eb8a9c9f2 /src/Game.php
parentedfd095021ee5d89f53da4fd78d7dea7346d7617 (diff)
Added identify form and Ratchet websockets test stuff
Diffstat (limited to 'src/Game.php')
-rw-r--r--src/Game.php29
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;
}
}