Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement game framework #22

Open
FastLizard4 opened this issue Apr 29, 2016 · 3 comments
Open

Implement game framework #22

FastLizard4 opened this issue Apr 29, 2016 · 3 comments

Comments

@FastLizard4
Copy link
Member

FastLizard4 commented Apr 29, 2016

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

@FastLizard4
Copy link
Member Author

Oh, and maybe for commands to be passed through to the games' CommandHandlers, use a different trigger to prevent conflicts with the bot's primary commands?

@wlritchi
Copy link
Contributor

Worth noting that this architecture may be obsolete or require changes in the post-PircBotX era (no guarantees either way; the PircBotX replacement is still in prototyping)

@FastLizard4
Copy link
Member Author

Right, but since there's no timeframe for replacing PircBotX, I'd say we might as well implement this now so we can get started on the games, and cross the post-PircBotX bridge when we get to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants