Adiciona tetos maximos por componente
- Componente A: teto 450 pts - Componente B: teto 180 pts - Componente C: teto 230 pts - Componente D: teto 180 pts Adiciona campo teto no ComponentePontuacao que limita o total
This commit is contained in:
@@ -9,10 +9,14 @@ class ComponentePontuacao:
|
||||
extras: int
|
||||
bonus: int
|
||||
retorno: int = 0
|
||||
teto: int = 0
|
||||
|
||||
@property
|
||||
def total(self) -> int:
|
||||
return self.base + self.tempo + self.extras + self.bonus + self.retorno
|
||||
soma = self.base + self.tempo + self.extras + self.bonus + self.retorno
|
||||
if self.teto > 0:
|
||||
return min(soma, self.teto)
|
||||
return soma
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
|
||||
Reference in New Issue
Block a user