diff --git a/nullptr/models/marketplace.py b/nullptr/models/marketplace.py index 88dbdc7..6bf916a 100644 --- a/nullptr/models/marketplace.py +++ b/nullptr/models/marketplace.py @@ -8,18 +8,26 @@ from typing import List, Tuple SUPPLY = ['SCARCE','LIMITED','MODERATE','HIGH','ABUNDANT'] ACTIVITY =['RESTRICTED','WEAK','GROWING','STRONG'] + class MarketEntry: - buy: int - sell: int - volume: int - supply: int - activity: int - history: List[Tuple[int, int, int, int, int, int]] = [] + def __init__(self): + self.buy = 0 + self.sell = 0 + self.volume = 0 + self.supply = 0 + self.activity = 0 + self.history = [] + def upg(self): + if not hasattr(self, 'history'): + self.history = [] + def f(self, detail=1): + self.upg() return f'b: {self.buy} s:{self.sell} hist: {len(self.history)}' def add(self, buy, sell, volume, supply, activity): + self.upg() self.buy = buy self.sell = sell self.volume = volume