Model AI game sides as GamePlayerAi, unioned in GamePlayers#659
Open
aslanyerdelen wants to merge 1 commit into
Open
Model AI game sides as GamePlayerAi, unioned in GamePlayers#659aslanyerdelen wants to merge 1 commit into
aslanyerdelen wants to merge 1 commit into
Conversation
Follow-up to lichess-org#658 implementing the suggested shape: GamePlayerUser keeps user/rating required and is only for registered players; AI sides (players.<color> == {"aiLevel": n}, e.g. game p66Eii3m) get their own schema, and GamePlayers unions the two per color. aiLevel moves out of GamePlayerUser since a registered player side never carries it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #658, implementing the shape @gameroman suggested there: a separate schema for AI sides plus a union, instead of loosening
GamePlayerUser.Changes
New
GamePlayerAi:aiLevelrequired, optional per-sideanalysis. Matches what the API returns for games against the computer:GamePlayers.white/blackbecomeoneOf: [GamePlayerUser, GamePlayerAi]GamePlayerUserstays exactly as strict as today for registered players (user/ratingrequired); onlyaiLevelmoves out, since a registered player side never carries itGamePlayerAiregistered in_index.yamlredocly lintpasses with no new warnings.Open question
Fully anonymous players may also appear as a side with neither
usernoraiLevel. I have no verified sample of that payload, so this PR deliberately doesn't model it — happy to add a third variant to the union if you can confirm the shape.