-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgame.py
59 lines (47 loc) · 1.63 KB
/
game.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
from enum import Enum, auto
import utils
class Category(Enum):
Game = auto()
DLC = auto()
Collection = auto()
Video = auto()
class HFRData(utils.ComparableClass):
def __init__(self, is_available, requirements, is_new, gift_date):
self.is_available = is_available
self.requirements = requirements
self.is_new = is_new
self.gift_date = gift_date
class StoreData(utils.ComparableClass):
def __init__(self):
self.description = ''
self.image = ''
self.os = list()
self.price = None
self.genres = list()
self.release_date = None
self.link = ''
self.category = None
self.avg_review = None
self.cnt_review = None
self.tags = list()
self.details = list()
self.override = False
self.interface = list()
self.audio = list()
self.subtitles = list()
class Game(utils.ComparableClass):
def __init__(self, is_available=False, requirements=None,
is_new=False, gift_date=None):
self.hfr = HFRData(is_available, requirements,
is_new, gift_date)
self.store = StoreData()
self.wine = None
def __getstate__(self):
state = self.__dict__.copy()
# no need to cache wine
# but it breaks multiprocessing
#if ('wine' in state):
# del state['wine']
return state
def __setstate__(self, state):
self.__dict__.update(state)