Skip to content

Implement game framework #22

@FastLizard4

Description

@FastLizard4

Implement a basic framework for handling IRC games in the bot.

I was thinking that we probably want to handle game-related commands separately from other CommandHandlers. I was thinking have a GameHandler that acts as an intermediary CommandHandler between the bot and the various game packages, and is a per-channel CommandHandler.

Basic sketch:

  1. When no games are being played, GameHandler provides a ?play command that takes the name of the game to be played as an argument.
  2. Now, with a game selected but not yet started, GameHandler hands control of game setup to the appropriate game classes, but allows the selected game to be changed too - i.e., proxying the commands of the game's CommandHandler, but also still responding to the ?play command.
  3. Once the game setup is completed and it starts, the game classes signal GameHandler that the game is now properly in progress, and prevents the game from being switched - at this point, the game is under control of game class entirely, and GameHandler proxies everything to the game class's commandhandler.
  4. When the game is over, the game class signals this to GameHandler; return to 1.

Blocks #10, #20, and #21

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions