-
Notifications
You must be signed in to change notification settings - Fork 160
[Werewolf V0.2] - Game Logic #426
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
wolves = [p for p in self.state.alive_players() if p.role.team == Team.WEREWOLVES] | ||
villagers = [p for p in self.state.alive_players() if p.role.team == Team.VILLAGERS] | ||
|
||
if not wolves: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hannw It looks like we're missing a state for the case where a single player causes the game to end early, such as by timing out or delivering invalid responses. It looks like penalizing just the player causing the error wouldn't be too tricky to add here. Would it be a reasonable lift to integrate with the other error handling?
perceived_threat_level: Optional[PerceivedThreatLevel] = Field( | ||
default=PerceivedThreatLevel.SAFE, access=DataAccessLevel.PERSONAL | ||
) | ||
action: Optional[BaseAction] = Field(default=None, access=DataAccessLevel.PERSONAL) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@hannw Looks like this line is the cause of a Pydantic deprecation alert:
PydanticDeprecatedSince20: Using extra keyword arguments on
Fieldis deprecated and will be removed. Use
json_schema_extra instead. (Extra keys: 'access'). Deprecated in Pydantic V2.0 to be removed in V3.0.
Gemini suggests instead:
action: Optional[BaseAction] = Field(default=None, json_schema_extra={"access": DataAccessLevel.PERSONAL})
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also affects lines 37 and 40.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM given the history of manual testing. I would like to follow up to remove the deprecation alerts.
No description provided.