Give a clone of the map to the player
This commit is contained in:
parent
aa5b65aecc
commit
ff45151c6f
|
@ -111,7 +111,7 @@ class Game:
|
|||
|
||||
def map(self):
|
||||
"""
|
||||
Returns the current map, the last map in the history.
|
||||
Returns a clone of the current map, the last map in the history.
|
||||
"""
|
||||
return self.history[-1].map.clone()
|
||||
|
||||
|
@ -134,7 +134,7 @@ class Game:
|
|||
|
||||
# Play next move
|
||||
for id, pp in enumerate(self.pps):
|
||||
(pp.position, pp.player.direction) = pp.player.next_position_and_direction(pp.position, id + 1, self.history[-1].map)
|
||||
(pp.position, pp.player.direction) = pp.player.next_position_and_direction(pp.position, id + 1, self.map())
|
||||
|
||||
# Update history with newly played move
|
||||
self.history[-1].player_one_direction = self.pps[0].player.direction
|
||||
|
|
Loading…
Reference in New Issue