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