-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
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:
- When no games are being played, GameHandler provides a ?play command that takes the name of the game to be played as an argument.
- 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.
- 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.
- When the game is over, the game class signals this to GameHandler; return to 1.