<commit_before>from twisted.python import log

from peloid import const
from peloid.app.mud import parser, room, world


class Game(object):
    """
    """
    def __init__(self, gameFile=None):
        self.gameFile = gameFile
        # XXX also, load game here
        self.mode = None
        self.parser = None

    def start(self, *args, **kwargs):
        pass

    def setMode(self, mode):
        """
        Legal modes are:
         * const.modes.lobby
         * const.modes.create
         * const.modes.controll
         * const.modes.avatar
         * const.modes.play
         * const.modes.observe
         * const.modes.chat

        These correspond to the following in-game locations:
         * Hall of Halls
         * Hall of Creators
         * Hall of Contorllers
         * Hall of Avatars
         * anywhere in-game (in a World instance)
         * Hall of Viewing
         * Hall of Banality

        Each mode will have its own CommandParser.
        """
        self.mode = mode
        if self.mode == const.modes.lobby:
            self.parser = parser.HallsCommandParser()
        elif self.mode == const.modes.create:
            self.parser = parser.CreatorsCommandParser()
        elif self.mode == const.modes.controll:<commit_msg>Added placeholder for loading a game.<commit_after>from twisted.python import log

from peloid import const
from peloid.app.mud import parser, room, world


class Game(object):
    """
    """
    def __init__(self, gameFile=None):
        self.gameFile = gameFile
        # XXX also, load game here
        self.mode = None
        self.parser = None

    def loadGame(self):
        """
        When the game is loaded, there will be a door/exit in the Hall of
        Avatars, allowing one to enter the game world.
        """
        pass

    def start(self, *args, **kwargs):
        if self.gameFile:
            self.loadGame()

    def setMode(self, mode):
        """
        Legal modes are:
         * const.modes.lobby
         * const.modes.create
         * const.modes.controll
         * const.modes.avatar
         * const.modes.play
         * const.modes.observe
         * const.modes.chat

        These correspond to the following in-game locations:
         * Hall of Halls
         * Hall of Creators
         * Hall of Contorllers
         * Hall of Avatars
         * anywhere in-game (in a World instance)
         * Hall of Viewing
         * Hall of Banality

        Each mode will have its own CommandParser.
        """
        self.mode = mode
        if self.mode == const.modes.lobby:
            self.parser = parser.HallsCommandParser()
        elif self.mode == const.modes.create:
            self.parser = parser.CreatorsCommandParser()
        elif self.mode == const.modes.controll:
{'fraction_non_alphanumeric': 0.08768790264853257, 'fraction_numerical': 0.0, 'mean_word_length': 1.7810945273631842, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1321167', 'n_tokens_mistral': 793, 'n_tokens_neox': 755, 'n_words': 233}