Checkpoint initial implementation

This commit is contained in:
Andrew Miner
2025-10-06 17:41:18 -06:00
parent 773e0a3d85
commit a8b6e6b15e
106 changed files with 3012 additions and 0 deletions
+36
View File
@@ -0,0 +1,36 @@
from tungston.core.fauna.active import Active
import tungston.core.fauna.active as AC
# Class ############################################################################################
class Mob:
"""
A creature which may appear in the game world.
"""
def __init__(self, name:str, gameId:str, active:tuple[Active]=AC.DIURNAL):
self.name = name
self.gameId = gameId
self.active = active
if not self.active:
self.active = AC.DIURNAL
if isinstance(self.active, Active):
self.active = (self.active,)
def __eq__(self, other) -> bool:
if type(self) != type(other): return False
if self.gameId != other.gameId: return False
return True
def __hash__(self) -> int:
return hash(self.gameId)
def __str__(self) -> str:
return self.name
def __repr__(self) -> str:
return f"{self.name}<{self.gameId}>{{active:{self.active}}}"