Added constructor params

This commit is contained in:
Marcin Kostrzewski 2020-04-04 20:53:33 +02:00
parent c454d8d328
commit 5e021ca087

View File

@ -1,9 +1,9 @@
class Statistics:
def __init__(self):
self.hp = 100
self.hunger = 100
self.thirst = 100
self.stamina = 100
def __init__(self, hp, hunger, thirst, stamina):
self.hp = hp
self.hunger = hunger
self.thirst = thirst
self.stamina = stamina
# methods that don't let the values pass below 0 and over 100 during change
def set_hp(self, hp_diff):
@ -42,5 +42,3 @@ class Statistics:
else:
self.hp = 100