Update game module and dependents for the 2019 game.

This commit is contained in:
Patrick Fairbank
2019-07-21 17:52:34 -07:00
parent 7e788b6d23
commit ad1891cd91
30 changed files with 396 additions and 1304 deletions

View File

@@ -28,6 +28,7 @@ type EventSettings struct {
PlcAddress string
AdminPassword string
ReaderPassword string
HabDockingThreshold int
}
const eventSettingsId = 0
@@ -45,6 +46,7 @@ func (database *Database) GetEventSettings() (*EventSettings, error) {
eventSettings.ApTeamChannel = 157
eventSettings.ApAdminChannel = 0
eventSettings.ApAdminWpaKey = "1234Five"
eventSettings.HabDockingThreshold = 15
err = database.eventSettingsMap.Insert(eventSettings)
if err != nil {

View File

@@ -15,7 +15,7 @@ func TestEventSettingsReadWrite(t *testing.T) {
assert.Nil(t, err)
assert.Equal(t, EventSettings{Id: 0, Name: "Untitled Event", NumElimAlliances: 8, SelectionRound2Order: "L",
SelectionRound3Order: "", TBADownloadEnabled: true, ApTeamChannel: 157, ApAdminChannel: 0,
ApAdminWpaKey: "1234Five"}, *eventSettings)
ApAdminWpaKey: "1234Five", HabDockingThreshold: 15}, *eventSettings)
eventSettings.Name = "Chezy Champs"
eventSettings.NumElimAlliances = 6

View File

@@ -25,7 +25,7 @@ func TestMatchResultCrud(t *testing.T) {
assert.Nil(t, err)
assert.Equal(t, matchResult, matchResult2)
matchResult.BlueScore.AutoRuns = 12
matchResult.BlueScore.RobotEndLevels = [3]int{3, 3, 3}
db.SaveMatchResult(matchResult)
matchResult2, err = db.GetMatchResultForMatch(254)
assert.Nil(t, err)