Add ladders in the map

This commit is contained in:
Yohann D'ANELLO
2020-12-26 00:52:47 +01:00
parent ad5ae22e5f
commit 8636d571b5
4 changed files with 13 additions and 4 deletions

View File

@ -198,6 +198,7 @@ class Tile(Enum):
EMPTY = auto()
WALL = auto()
FLOOR = auto()
LADDER = auto()
@staticmethod
def from_ascii_char(ch: str) -> "Tile":
@ -222,6 +223,12 @@ class Tile(Enum):
"""
return self == Tile.WALL
def is_ladder(self) -> bool:
"""
Is this Tile a ladder?
"""
return self == Tile.LADDER
def can_walk(self) -> bool:
"""
Check if an entity (player or not) can move in this tile.