0ptr/nullptr/models/agent.py

20 lines
341 B
Python
Raw Normal View History

2023-06-10 17:39:32 +00:00
from .base import Base
class Agent(Base):
def define(self):
self.token: str = None
self.credits: int = 0
2023-06-10 17:39:32 +00:00
def update(self, d):
2023-06-10 18:49:50 +00:00
self.seta('credits', d)
2023-06-10 17:39:32 +00:00
@classmethod
def ext(self):
return 'agt'
def f(self, detail=1):
r = super().f(detail)
if detail >2:
r += f' c:{self.credits}'
return r