-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathPlayer.py
More file actions
executable file
·57 lines (44 loc) · 1.21 KB
/
Player.py
File metadata and controls
executable file
·57 lines (44 loc) · 1.21 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
49
50
51
52
53
54
55
56
57
#!/usr/bin/env python3
# Player Class
#
# [class] Player
# [enum] Class Selection
# [enum] Ascendancy Selection
# [dict] Stats (e.g. Str/Dex/Int, Hit/Crit, Life/Mana,
# Block/Spell Block/Evade/Dodge, etc.)
# [dict] Item Slots
# [per slot ref] Item
# [optional list] Minions
from enum import Enum
class PlayerClasses(Enum):
SCION = 0
MARAUDER = 1
RANGER = 2
WITCH = 3
DUELIST = 4
TEMPLAR = 5
SHADOW = 6
class PlayerAscendancy(Enum):
NONE = None
class Player:
def __init__(
self,
player_class: PlayerClasses = PlayerClasses.SCION,
ascendancy: PlayerAscendancy = PlayerAscendancy.NONE,
level: int = 1,
) -> None:
self.player_class = player_class
self.ascendancy = ascendancy
self.level = level
self.stats = dict()
self.item_slots = dict()
self.minions = dict()
def __repr__(self) -> str:
ret_str = f"Level {self.level} {self.player_class.name}"
ret_str += f" {self.ascendancy.value}\n" if self.ascendancy.value else "\n"
return ret_str
def test() -> None:
player = Player()
print(player)
if __name__ == "__main__":
test()