-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmodels.py
More file actions
48 lines (40 loc) · 1.01 KB
/
models.py
File metadata and controls
48 lines (40 loc) · 1.01 KB
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
from dataclasses import dataclass
from uuid import UUID
@dataclass
class ArenaModel:
uuid:UUID
number_of_years:int
number_of_fighters:int
fights_per_year:int
max_turns:int
@dataclass
class MonsterMetricModel:
uuid:UUID
fighter_level:int
number_of_fighters:int
number_of_fights:int
def monster_metric_str(m:MonsterMetricModel):
return f"{m.uuid},{m.fighter_level},{m.number_of_fighters},{m.number_of_fights}"
@dataclass
class CharacterModel:
uuid:UUID
name:str
hit_dice:int
max_hit_points:int
rolled_hit_points:int
armor_class:int
strength:int
dexterity:int
constitution:int
wisdom:int
intelligence:int
charisma:int
def character_str(m:CharacterModel):
return f"{m.uuid},{m.name},{m.hit_dice},{m.max_hit_points},{m.rolled_hit_points},{m.strength},{m.dexterity},{m.constitution},{m.wisdom},{m.intelligence},{m.charisma}"
@dataclass
class ClassModel(CharacterModel):
experience:int
age:int
@dataclass
class PartyModel:
uuid:UUID