Initial Commit
This commit is contained in:
commit
d25706163c
34 changed files with 1035 additions and 0 deletions
17
src/dnd_dm_toolkit/core/sentinel.py
Normal file
17
src/dnd_dm_toolkit/core/sentinel.py
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
class _AllStatsSentinel:
|
||||
"""Sentinel для обозначения 'любые навыки'"""
|
||||
_instance = None
|
||||
|
||||
def __new__(cls):
|
||||
if cls._instance is None:
|
||||
cls._instance = super().__new__(cls)
|
||||
return cls._instance
|
||||
|
||||
def __repr__(self):
|
||||
return "ALL_STATS"
|
||||
|
||||
def __eq__(self, other: object) -> bool:
|
||||
return isinstance(other, _AllStatsSentinel)
|
||||
|
||||
def __hash__(self) -> int:
|
||||
return hash("ALL_STATS")
|
||||
Loading…
Add table
Add a link
Reference in a new issue