Giter VIP home page Giter VIP logo

tbago's People

Contributors

brenekh avatar carlcolglazier avatar erikboesen avatar tomorth avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

tomorth brenekh

tbago's Issues

Migrate to APIv3

First issue to address: backward compatibility. In an ideal world, we could just iterate the version number and everything would be good to go.

A quick fix for now could be to create a different client struct called something like TBAClient.

Match data is parsed poorly

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": {
    "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.

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.

        ScoreBreakdown struct {
		Red  interface{} `json:"red"`
		Blue interface{} `json:"blue"`
	} `json:"score_breakdown"`

We should not stay with this terrible solution.

Getting keys not supported

There are a great many TBA endpoints which allow fetching of a list of keys rather than a list of data. These are unsupported thus far by tbago.

More specific documentation needed

Currently we direct users interested in a full list of available requests to look in the source code. This isn't terribly hard, but we should provide a list up front in the README.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.