Skip to content

Commit

Permalink
Add the game code field.
Browse files Browse the repository at this point in the history
  • Loading branch information
Kharacternyk committed Dec 13, 2023
1 parent 22d0a71 commit 7c178f5
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions paper_tactics/entities/game_preferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,15 @@ class GamePreferences:
is_against_bot: bool = False
trench_density_percent: int = 0
is_double_base: bool = False
code: str = ""

@property
def valid(self) -> bool:
return (
isinstance(self.size, int)
and isinstance(self.turn_count, int)
and isinstance(self.trench_density_percent, int)
and isinstance(self.code, str)
and 3 <= self.size <= 12
and 1 <= self.turn_count <= 7
and 0 <= self.trench_density_percent <= 100
Expand Down

0 comments on commit 7c178f5

Please sign in to comment.