Prototype of web streaming
This commit is contained in:
@@ -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()]
|
||||
|
||||
Reference in New Issue
Block a user