-
Notifications
You must be signed in to change notification settings - Fork 0
/
Player.py
86 lines (67 loc) · 2.14 KB
/
Player.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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
from random import randint
class Player:
def __init__(
self,
communication: int,
reactionTime: int,
speed: int,
strength: int,
agility: int,
mood: int,
):
self.communication = communication
self.reactionTime = reactionTime
self.speed = speed
self.name = "Unnamed"
self.strength = strength
self.agility = agility
self.mood = mood
self.number = -1
def __str__(self) -> str:
return f"Number on team: {self.number}, Name: {self.getName()}, Communication: {self.getCommunication()}, Reaction Time: {self.getReactionTime()}, Speed: {self.getSpeed()}, Strength: {self.getStrength()}, Agility: {self.getAgility()}, Mood: {self.getMood()},"
def getCommunication(self) -> int:
return self.communication
def getMood(self) -> int:
return self.mood
def getReactionTime(self) -> int:
return self.reactionTime
def getSpeed(self) -> int:
return self.speed
def getAgility(self) -> int:
return self.agility
def getStrength(self) -> int:
return self.strength
def getName(self):
return self.name
def setName(self, name):
self.name = name
def setMood(self, mood):
self.mood = mood
def setCommunication(self, communication):
self.communication = communication
def setReactionTime(self, reactionTime):
self.reactionTime = reactionTime
def setSpeed(self, speed):
self.speed = speed
def setAgility(self, agility):
self.agility = agility
def setStrength(self, strength):
self.strength = strength
def getAverage(self):
total = 0
total += self.getAgility()
total += self.getMood()
total += self.getCommunication()
total += self.getReactionTime()
total += self.getSpeed()
total += self.getStrength()
return total / 6
def makeRandomPlayer() -> Player:
return Player(
randint(1, 100),
randint(1, 100),
randint(1, 100),
randint(1, 100),
randint(1, 100),
randint(1, 100),
)