2020-11-06 16:43:30 +00:00
|
|
|
class TexturePack:
|
|
|
|
_packs = dict()
|
|
|
|
|
|
|
|
name: str
|
|
|
|
EMPTY: str
|
|
|
|
WALL: str
|
|
|
|
FLOOR: str
|
|
|
|
PLAYER: str
|
|
|
|
|
2020-11-06 19:18:27 +00:00
|
|
|
ASCII_PACK: "TexturePack"
|
|
|
|
SQUIRREL_PACK: "TexturePack"
|
|
|
|
|
2020-11-06 16:43:30 +00:00
|
|
|
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":
|
2020-11-10 17:08:06 +00:00
|
|
|
return cls._packs[name.lower()]
|
2020-11-06 16:43:30 +00:00
|
|
|
|
|
|
|
|
|
|
|
TexturePack.ASCII_PACK = TexturePack(
|
|
|
|
name="ascii",
|
|
|
|
EMPTY=' ',
|
|
|
|
WALL='#',
|
|
|
|
FLOOR='.',
|
|
|
|
PLAYER='@',
|
|
|
|
)
|
|
|
|
|
|
|
|
TexturePack.SQUIRREL_PACK = TexturePack(
|
|
|
|
name="squirrel",
|
|
|
|
EMPTY=' ',
|
|
|
|
WALL='█',
|
|
|
|
FLOOR='.',
|
|
|
|
PLAYER='🐿️',
|
|
|
|
)
|