cmd_ANNOTATE, cmd_PORTAL, cmd_GET_GAMESTATE)
from plomrogue.io import GameIO
from plomrogue.misc import quote
-from plomrogue.things import Thing, ThingPlayer
+from plomrogue.things import Thing, ThingPlayer
from plomrogue.mapping import YX, MapGeometrySquare, Map
class GameBase:
def __init__(self):
- pass
self.turn = 0
self.things = []
def send_thing(thing):
self.io.send('THING_POS %s %s' % (thing.id_, t.position))
if hasattr(thing, 'nickname'):
- self.io.send('THING_NAME %s %s' % (thing.id_, t.nickname))
+ self.io.send('THING_NAME %s %s' % (thing.id_, quote(t.nickname)))
self.io.send('TURN ' + str(self.turn))
send_thing(t)
self.io.send('MAP %s %s' % (self.map_geometry.size, quote(self.map.terrain)))
for yx in self.portals:
- self.io.send('PORTAL %s %s' % (yx, self.portals[yx]))
+ self.io.send('PORTAL %s %s' % (yx, quote(self.portals[yx])))
self.io.send('GAME_STATE_COMPLETE')
def run_tick(self):
def set_next_task(self, task_name, args=()):
task_class = self.game.tasks[task_name]
- self.next_tasks += [task_class(self, args)]
+ self.next_tasks += [task_class(self, args)]
def get_next_task(self):
if len(self.next_tasks) > 0: