Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Hacksaar
Haxotel
Commits
6d1a22af
Commit
6d1a22af
authored
Jul 31, 2014
by
Constantin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
small fixes
parent
9bb21fa1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
labyrinth.py
labyrinth.py
+4
-3
No files found.
labyrinth.py
View file @
6d1a22af
...
...
@@ -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"
...
...
@@ -105,4 +105,5 @@ class Labyrinth:
def
createThing
(
self
,
thing
,
field
):
thing
.
field
=
field
field
.
_addThing
(
thing
)
\ No newline at end of file
field
.
_addThing
(
thing
)
thing
.
onMove
(
field
)
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment