0ptr/nullptr/models/agent.py

23 lines
403 B
Python

from .base import Base
class Agent(Base):
def define(self):
self.token: str = None
self.credits: int = 0
def update(self, d):
self.seta('credits', d)
def path(self):
return f'{self.symbol}.{self.ext()}'
@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