Make _start_game arguments generic.

It shouldn't need to know what specific parameters the game will take.
(And its "length" parameter was out of date since the games currently
use "difficulty".)
This commit is contained in:
Mike Mueller 2012-03-24 15:20:03 -07:00
parent d820ab1f1c
commit 4bc4c0d858
1 changed files with 2 additions and 2 deletions

View File

@ -118,7 +118,7 @@ class Wordgames(callbacks.Plugin):
raise WordgamesError("Unable to open word file: %s" % path)
return filter(regexp.match, map(str.strip, wordFile.readlines()))
def _start_game(self, Game, irc, channel, length):
def _start_game(self, Game, irc, channel, *args, **kwargs):
try:
game = self.games.get(channel)
if game and game.is_running():
@ -126,7 +126,7 @@ class Wordgames(callbacks.Plugin):
game.show()
else:
words = self._get_words()
self.games[channel] = Game(words, irc, channel, length)
self.games[channel] = Game(words, irc, channel, *args, **kwargs)
self.games[channel].start()
except WordgamesError, e:
irc.reply('Wordgames error: %s' % str(e))