Commit 6d1a22af authored by Constantin's avatar Constantin
Browse files

small fixes

parent 9bb21fa1
......@@ -26,11 +26,11 @@ class Labyrinth:
assert self.groundtype != Labyrinth.GroundType.WALL
self.things.append(thing)
def neighbor(self,dy,dx):
self.labyrinth.getTileAt(self.row + dy, self.column + dx)
return self.labyrinth.getTileAt(self.row + dy, self.column + dx)
def isWalkable(self):
# this may be more complicated in the future
return self.groundtype == Labyrinth.GroundType.FLOOR
def toString(self):
def __str__(self):
# always starts with there is/there are
if self.groundtype == Labyrinth.GroundType.WALL:
return "there is a wall"
......@@ -106,3 +106,4 @@ class Labyrinth:
def createThing (self, thing, field):
thing.field = field
field._addThing(thing)
thing.onMove(field)
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment