X-Git-Url: https://plomlompom.com/repos/berlin_corona.txt?a=blobdiff_plain;f=new2%2Fplomrogue%2Fgame.py;h=81bd530d8b3cde8c12db964042dabc505468256e;hb=8db0e200f8c2d279c68ca01b9ae235ab63c8f642;hp=e8c85da35adef872a0667bf97a75c09189049995;hpb=428ba19a1984f385f5fc55201734a150f59dafcb;p=plomrogue2-experiments diff --git a/new2/plomrogue/game.py b/new2/plomrogue/game.py index e8c85da..81bd530 100755 --- a/new2/plomrogue/game.py +++ b/new2/plomrogue/game.py @@ -1,4 +1,4 @@ -from plomrogue.tasks import Task_WAIT, Task_MOVE +from plomrogue.tasks import Task_WAIT, Task_MOVE, Task_WRITE from plomrogue.errors import GameError from plomrogue.commands import cmd_ALL, cmd_LOGIN, cmd_QUERY from plomrogue.io import GameIO @@ -36,7 +36,8 @@ class Game(GameBase): self.changed = True self.io = GameIO(self) self.tasks = {'WAIT': Task_WAIT, - 'MOVE': Task_MOVE} + 'MOVE': Task_MOVE, + 'WRITE': Task_WRITE} self.map_geometry = MapGeometrySquare(YX(24, 40)) self.commands = {'QUERY': cmd_QUERY, 'ALL': cmd_ALL, @@ -47,8 +48,12 @@ class Game(GameBase): self.map = Map(self.map_geometry.size) def get_string_options(self, string_option_type): + import string if string_option_type == 'direction': return self.map_geometry.get_directions() + if string_option_type == 'char': + return [c for c in + string.digits + string.ascii_letters + string.punctuation] return None def send_gamestate(self, connection_id=None):