feat(ects): add some helper functions for etcs

This commit is contained in:
Niklas Haiden
2026-05-08 16:44:21 +02:00
parent 538be47bc5
commit 2adc490f3d
+7
View File
@@ -2,6 +2,7 @@ import pygame
from src.settings import START_ECTS_VALUE, ECTS_UPDATE_INTERVAL from src.settings import START_ECTS_VALUE, ECTS_UPDATE_INTERVAL
class ECTS: class ECTS:
def __init__(self): def __init__(self):
# total amount of ECTS the player has at the beginning # total amount of ECTS the player has at the beginning
@@ -24,3 +25,9 @@ class ECTS:
# beer increases amount of how much ECTS are earned per second # beer increases amount of how much ECTS are earned per second
def upgrade_rate(self, extra_ects): def upgrade_rate(self, extra_ects):
self.ects_per_second += extra_ects self.ects_per_second += extra_ects
def is_over_balance(self, amount):
return self.ects_balance >= amount
def decrease_balance(self, amount):
self.ects_balance -= amount