summaryrefslogtreecommitdiff
path: root/src/Game.php
blob: 1bedba269121260f8d7bf9f4e50494526b86e013 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php

namespace App;

use App\Message\Handler;

/**
 * A Game class that handles game execution
 *
 * @author Phil Burton <phil@pgburton.com>
 */
class Game
{
    /**
     * Constuct a new Game
     *
     * @author Phil Burton <phil@pgburton.com>
     */
    public function __construct()
    {
        $this->init();
    }

    /**
     * Initalise the Game
     *
     * @author Phil Burton <phil@pgburton.com>
     */
    protected function init()
    {
        // Do any pre set-up
        $this->handler = new Handler(['inject']);
        $this->sendOpeningMessage();
    }

    /**
     * Send opening message
     * @author Phil Burton <phil@pgburton.com>
     */
    public function sendOpeningMessage()
    {
        $message = $this->handler->renderOpeningMessage();
        sleep(1);
        $message2 = $this->handler->renderOpeningMessage();

        $important = $this->handler->returnImportant('inject');

        var_dump($message, $important, $message2);
    }
}