<commit_before><?php
namespace BeardedOctoNinja\Controller;
use BeardedOctoNinja\Model\Maze;
/**
 * Created by PhpStorm.
 * User: steph
 * Date: 27/10/13
 * Time: 05:16
 */

class GameController {
    private $maze = null;
    private $size = 21;
    private $name = null;
    public function startGame() {
        $this->maze = new Maze($this->name, $this->size, $this->size);
    }

    public function processMessage($msg) {
        switch ($msg['type']) {
            case 'create':
                $this->name = $msg['message'];
                $this->size = $msg['size'];
                $this->startGame();
                $response = array(
                    'operation' => 'GAME',
                    'type' => 'new',
                    'recipient' => 'ALL',
                    'grid' => $this->maze->get_grid(),
                    'size' => $this->size,
                    'name' => $this->name
                );
                return $response;
                break;
        }
        return 'noendpoint';
    }
}<commit_msg>added the last of the game controller message formats<commit_after><?php
namespace BeardedOctoNinja\Controller;
use BeardedOctoNinja\Model\Maze;
/**
 * Created by PhpStorm.
 * User: steph
 * Date: 27/10/13
 * Time: 05:16
 */

class GameController {
    private $maze = null;
    private $size = 21;
    private $name = null;
    public function startGame() {
        $this->maze = new Maze($this->name, $this->size, $this->size);
    }

    public function processMessage($msg) {
        switch ($msg['type']) {
            case 'create': // Client requested a new game -- let's set one up and send them the details back :)
                $this->name = $msg['message'];
                $this->size = $msg['size'];
                $this->startGame();
                $response = array(
                    'operation' => 'GAME',
                    'type' => 'new',
                    'recipient' => 'ALL',
                    'grid' => $this->maze->get_grid(),
                    'size' => $this->size,
                    'name' => $this->name
                );
                return $response;
                break;
            case 'end':
                return array(
                    'operation' => 'GAME',
                    'type' => 'end',
                    'name' => 'GAME_NAME', // Name of the game you wanna stops
                    'reason' => 'REASON' // Reason for stopping it, best be a good one!
                );
                break;
            default:
                return NULL;
                break;
        }
    }
}
{'fraction_non_alphanumeric': 0.1418139892390469, 'fraction_numerical': 0.009223674096848577, 'mean_word_length': 1.385884509624198, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 41, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4147335', 'n_tokens_mistral': 767, 'n_tokens_neox': 704, 'n_words': 183}