Add suggestPositionShot schema types and operation
Mirrors the backend's position-play search: SuggestPositionShotInputGQL (pot lock + target-area polygon), PositionSuggestionGQL / PositionShotCandidateGQL / CueStrikeGQL, the Query field, and a SuggestPositionShot operation with a shared candidate fragment. Rebased onto master's gql; index.tsx regenerated. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
16209
src/index.tsx
16209
src/index.tsx
File diff suppressed because it is too large
Load Diff
@@ -85,3 +85,53 @@ query ComputePotAim(
|
||||
occludingBallIds
|
||||
}
|
||||
}
|
||||
|
||||
fragment PositionShotCandidate on PositionShotCandidateGQL {
|
||||
strike {
|
||||
v0
|
||||
phi
|
||||
theta
|
||||
a
|
||||
b
|
||||
}
|
||||
cueFinalPosition
|
||||
inTargetArea
|
||||
distanceToTargetArea
|
||||
robustness
|
||||
potted
|
||||
scratched
|
||||
projection {
|
||||
trajectories {
|
||||
ballId
|
||||
points {
|
||||
time
|
||||
position
|
||||
}
|
||||
}
|
||||
events {
|
||||
eventType
|
||||
time
|
||||
ballIds
|
||||
position
|
||||
}
|
||||
finalState {
|
||||
ballId
|
||||
position
|
||||
}
|
||||
pottedBallIds
|
||||
}
|
||||
}
|
||||
|
||||
query SuggestPositionShot($suggestionInput: SuggestPositionShotInputGQL!) {
|
||||
suggestPositionShot(suggestionInput: $suggestionInput) {
|
||||
achievable
|
||||
evaluatedCount
|
||||
successfulCount
|
||||
best {
|
||||
...PositionShotCandidate
|
||||
}
|
||||
alternates {
|
||||
...PositionShotCandidate
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,6 +81,9 @@ type Query {
|
||||
targetBallId: Int!
|
||||
pocket: PocketIdentifier!
|
||||
): PotAimGQL!
|
||||
suggestPositionShot(
|
||||
suggestionInput: SuggestPositionShotInputGQL!
|
||||
): PositionSuggestionGQL!
|
||||
getOrderedShots(
|
||||
filterInput: FilterInput!
|
||||
ids: [Int!] = null
|
||||
@@ -1219,6 +1222,44 @@ type PotAimGQL {
|
||||
occludingBallIds: [Int!]!
|
||||
}
|
||||
|
||||
type PositionSuggestionGQL {
|
||||
achievable: Boolean!
|
||||
best: PositionShotCandidateGQL
|
||||
alternates: [PositionShotCandidateGQL!]!
|
||||
evaluatedCount: Int!
|
||||
successfulCount: Int!
|
||||
}
|
||||
|
||||
type PositionShotCandidateGQL {
|
||||
strike: CueStrikeGQL!
|
||||
cueFinalPosition: [Float!]!
|
||||
inTargetArea: Boolean!
|
||||
distanceToTargetArea: Float!
|
||||
robustness: Int!
|
||||
potted: Boolean!
|
||||
scratched: Boolean!
|
||||
projection: ShotProjectionGQL
|
||||
}
|
||||
|
||||
type CueStrikeGQL {
|
||||
v0: Float!
|
||||
phi: Float!
|
||||
theta: Float!
|
||||
a: Float!
|
||||
b: Float!
|
||||
}
|
||||
|
||||
input SuggestPositionShotInputGQL {
|
||||
cueBallId: Int!
|
||||
targetBallId: Int!
|
||||
pocket: PocketIdentifier!
|
||||
targetArea: [[Float!]!]!
|
||||
balls: [SimulationBallStateInputGQL!] = null
|
||||
b64Image: String = null
|
||||
useHomography: HomographyInputGQL = null
|
||||
tableSize: Float = null
|
||||
}
|
||||
|
||||
type GetShotsResult {
|
||||
shots: [ShotGQL!]!
|
||||
count: Int
|
||||
|
||||
Reference in New Issue
Block a user