0ptr/nullptr/models/agent.py
2024-01-24 19:03:57 +01:00

24 lines
529 B
Python

from .base import Base
from nullptr.models.waypoint import Waypoint
class Agent(Base):
def define(self):
self.token: str = None
self.credits: int = 0
self.headquarters: Waypoint = None
def update(self, d):
self.seta('credits', d)
getter = self.store.getter(Waypoint, create=True)
self.seta('headquarters', d, interp=getter)
@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