squirrel-battle/dungeonbattle/display/texturepack.py
2020-11-06 20:18:27 +01:00

38 lines
682 B
Python

class TexturePack:
_packs = dict()
name: str
EMPTY: str
WALL: str
FLOOR: str
PLAYER: str
ASCII_PACK: "TexturePack"
SQUIRREL_PACK: "TexturePack"
def __init__(self, name: str, **kwargs):
self.name = name
self.__dict__.update(**kwargs)
TexturePack._packs[name] = self
@classmethod
def get_pack(cls, name: str) -> "TexturePack":
return cls._packs[name]
TexturePack.ASCII_PACK = TexturePack(
name="ascii",
EMPTY=' ',
WALL='#',
FLOOR='.',
PLAYER='@',
)
TexturePack.SQUIRREL_PACK = TexturePack(
name="squirrel",
EMPTY=' ',
WALL='',
FLOOR='.',
PLAYER='🐿️',
)