Added entities management to class Map
This commit is contained in:
parent
5728abc02c
commit
ba4bb78166
|
@ -1,14 +1,16 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
|
||||
class Map:
|
||||
width: int
|
||||
height: int
|
||||
tiles: list
|
||||
|
||||
def __init__(self, width: int, height: int, tiles: list):
|
||||
def __init__(self, width: int, height: int, tiles: list, entities: list):
|
||||
self.width = width
|
||||
self.height = height
|
||||
self.tiles = tiles
|
||||
self.entities = entities
|
||||
|
||||
@staticmethod
|
||||
def load(filename: str):
|
||||
|
@ -22,7 +24,7 @@ class Map:
|
|||
lines = [line for line in lines if line]
|
||||
height = len(lines)
|
||||
width = len(lines[0])
|
||||
return Map(width, height, lines)
|
||||
return Map(width, height, lines, [])
|
||||
|
||||
|
||||
class Entity:
|
||||
|
|
Loading…
Reference in New Issue