Add per-condition encounter rates to seed data (#26)
All checks were successful
CI / backend-lint (push) Successful in 9s
CI / actions-lint (push) Successful in 15s
CI / frontend-lint (push) Successful in 20s

Co-authored-by: Julian Tabel <juliantabel.jt@gmail.com>
Co-committed-by: Julian Tabel <juliantabel.jt@gmail.com>
This commit was merged in pull request #26.
This commit is contained in:
2026-02-17 19:38:29 +01:00
committed by TheFurya
parent d0fff248fe
commit 7df56325a8
38 changed files with 36723 additions and 11591 deletions

View File

@@ -13,16 +13,22 @@ class Encounter:
encounter_rate: int
min_level: int
max_level: int
conditions: dict[str, int] | None = None
def to_dict(self) -> dict:
return {
d: dict = {
"pokeapi_id": self.pokeapi_id,
"pokemon_name": self.pokemon_name,
"method": self.method,
"encounter_rate": self.encounter_rate,
"min_level": self.min_level,
"max_level": self.max_level,
}
if self.conditions:
d["encounter_rate"] = None
d["conditions"] = self.conditions
else:
d["encounter_rate"] = self.encounter_rate
return d
@dataclass