def new(cls, name, **kwargs): p = cls(id=default_uuid()) p.name = name p.reset() for k, v in kwargs.items(): setattr(p, k, v) return p
def add_message(self, timestamp, type, message): m = Message(id=default_uuid(), timestamp=timestamp, type=type, message=message) self.messages[m.id] = m return m
def get_game(): db = get_db() try: game = db['game'] except KeyError: game = Game(default_uuid()) db['game'] = game return db['game']
def new(cls, name, **kwargs): n = cls(id=default_uuid()) n.name = name # n.higher_edges = [] # n.lower_edges = [] # n.wallet = Wallet() for k, v in kwargs.items(): setattr(n, k, v) return n
def new(cls, name, **kwargs): t = cls(id=default_uuid()) t.name = name t.players = set() return t
def new(cls, player, fundings): b = cls(id=default_uuid()) b.player = player b.fundings = fundings return b
def reset(self): self.wallet = Wallet() self.token = default_uuid() self.goal_id = None self.policies = Dict()
def new(cls): return cls(id=default_uuid())
def new(cls, n1, n2, weight): e = cls(id=default_uuid()) return e.init(n1, n2, weight)