We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Match data is quite complicated, and handling it through a statically typed language like Go can be troublesome.
The score_breakdown JSON property is particularly problematic here. A typical match request might yield the following JSON:
score_breakdown
"score_breakdown": { "blue": { "adjustPoints": 0, "autoFuelHigh": 0, "autoFuelLow": 0, "autoFuelPoints": 0, "autoMobilityPoints": 15, "autoPoints": 15, "autoRotorPoints": 0, "foulCount": 0, "foulPoints": 0, "kPaBonusPoints": 0, "kPaRankingPointAchieved": false, "robot1Auto": "Mobility", "robot2Auto": "Mobility", "robot3Auto": "Mobility", "rotor1Auto": false, "rotor1Engaged": true, "rotor2Auto": false, "rotor2Engaged": true, "rotor3Engaged": false, "rotor4Engaged": false, "rotorBonusPoints": 0, "rotorRankingPointAchieved": false, "tba_rpEarned": 0, "techFoulCount": 0, "teleopFuelHigh": 8, "teleopFuelLow": 0, "teleopFuelPoints": 2, "teleopPoints": 82, "teleopRotorPoints": 80, "teleopTakeoffPoints": 0, "totalPoints": 97, "touchpadFar": "None", "touchpadMiddle": "None", "touchpadNear": "None" }, "red": { "same properties as blue" } }
The issue is that the properties of blue and red are different across games.
blue
red
The only solution I can currently see to this is to write every possible property into the Match struct.
Match
Currently we use this horrible placeholder.
ScoreBreakdown struct { Red interface{} `json:"red"` Blue interface{} `json:"blue"` } `json:"score_breakdown"`
We should not stay with this terrible solution.
The text was updated successfully, but these errors were encountered:
2b876e4
Fix interface{} confusion in ScoreBreakdown field of Match
7e93fb1
I've written specific JSON marshalling code so users will no longer have to deal with interfaces to get specific match breakdown data. Fixes #6
No branches or pull requests
Match data is quite complicated, and handling it through a statically typed language like Go can be troublesome.
The
score_breakdown
JSON property is particularly problematic here. A typical match request might yield the following JSON:The issue is that the properties of
blue
andred
are different across games.The only solution I can currently see to this is to write every possible property into the
Match
struct.Currently we use this horrible placeholder.
We should not stay with this terrible solution.
The text was updated successfully, but these errors were encountered: