Prototype of web streaming

This commit is contained in:
Yohann D'ANELLO
2020-12-02 16:01:32 +01:00
parent e5886bbe44
commit 1ba6b1fbec
3 changed files with 77 additions and 2 deletions

View File

@@ -18,6 +18,12 @@ class TexturePack:
WALL: str
FLOOR: str
PLAYER: str
HEDGEHOG: str
HEART: str
BOMB: str
RABBIT: str
TIGER: str
TEDDY_BEAR: str
ASCII_PACK: "TexturePack"
SQUIRREL_PACK: "TexturePack"
@@ -30,6 +36,9 @@ class TexturePack:
def __getitem__(self, item: str) -> Any:
return self.__dict__[item]
def __contains__(self, item) -> bool:
return any(self[key] == item for key in self.__dict__ if key.isupper())
@classmethod
def get_pack(cls, name: str) -> "TexturePack":
return cls._packs[name.lower()]