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:
Frederico Castro
2025-12-13 12:33:46 -03:00
parent b18ae8199c
commit c909608e46
2 changed files with 9 additions and 5 deletions

View File

@@ -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)