Time + fame backward compatible with previous 0.8.1

This commit is contained in:
Wiktor Mazur
2020-03-02 21:53:07 +01:00
parent 6720adc78b
commit cffca90288
6 changed files with 131 additions and 36 deletions
+26
View File
@@ -0,0 +1,26 @@
import abc
class Stats(abc.ABC):
@abc.abstractmethod
def new(self):
pass
@abc.abstractclassmethod
def from_other(other):
pass
@abc.abstractmethod
def update(self, other):
pass
@abc.abstractmethod
def stats(self):
pass
def combined(self, other):
stats = self.new()
stats.update(self)
stats.update(other)
return stats