X-Git-Url: https://plomlompom.com/repos/day?a=blobdiff_plain;f=server_%2Fgame.py;h=07dde9d5011144f155758a0304479b1c046a94df;hb=795a476f5d4ba157f3287d7e2f5893cc91b6732e;hp=4cd28fba99b2ba13426da0563482ca5d21723209;hpb=64bf1873a6686c1bc974321c13d3c9f7800db0d6;p=plomrogue2-experiments diff --git a/server_/game.py b/server_/game.py index 4cd28fb..07dde9d 100644 --- a/server_/game.py +++ b/server_/game.py @@ -10,12 +10,12 @@ class GameError(Exception): class World(game_common.World): - def __init__(self): + def __init__(self, game): super().__init__() + self.game = game self.player_id = 0 # use extended local classes self.Thing = Thing - self.get_map_class = server_.map_.get_map_class def proceed_to_next_player_turn(self): """Run game world turns until player can decide their next step. @@ -163,7 +163,8 @@ class Game(game_common.CommonCommandsMixin): def __init__(self, game_file_name): import server_.io - self.world = World() + self.map_manager = server_.map_.map_manager + self.world = World(self) self.io = server_.io.GameIO(game_file_name, self) # self.pool and self.pool_result are currently only needed by the FIB # command and the demo of a parallelized game loop in cmd_inc_p. @@ -179,8 +180,8 @@ class Game(game_common.CommonCommandsMixin): return 'Y:' + str(tuple_[0]) + ',X:' + str(tuple_[1]) self.io.send('NEW_TURN ' + str(self.world.turn)) - grid = self.world.map_.__class__.__name__[3:] - self.io.send('MAP ' + grid +' ' + stringify_yx(self.world.map_.size)) + self.io.send('MAP ' + self.world.map_.geometry +\ + ' ' + stringify_yx(self.world.map_.size)) visible_map = self.world.get_player().get_visible_map() for y, line in visible_map.lines(): self.io.send('VISIBLE_MAP_LINE %5s %s' % (y, self.io.quote(line)))