-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlevel.py
More file actions
23 lines (19 loc) · 816 Bytes
/
level.py
File metadata and controls
23 lines (19 loc) · 816 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from tile import Tile
from direction import Direction
class Level:
def __init__(self, map: list[list[Tile]]) -> None:
self.map = map
self.left = None
self.right = None
self.up = None
self.down = None
def set_bordering(self, level, direction: Direction):
if direction == Direction.LEFT: self.left = level
if direction == Direction.RIGHT: self.right = level
if direction == Direction.UP: self.up = level
if direction == Direction.DOWN: self.down = level
def get_bordering(self, direction: Direction):
if direction == Direction.LEFT: return self.left
if direction == Direction.RIGHT: return self.right
if direction == Direction.UP: return self.up
if direction == Direction.DOWN: return self.down