horse, mdb, cmd/horsebot: racecourses
ci/woodpecker/push/horsebot Pipeline was successful
ci/woodpecker/push/zenno Pipeline failed

This commit is contained in:
2026-09-08 15:56:01 -04:00
parent 30f89e86f0
commit 3bf17944b3
127 changed files with 14697 additions and 0 deletions
+49
View File
@@ -13,6 +13,55 @@ type Race struct {
Primary RaceID `json:"primary"`
}
type RaceTrackID int32
type RacecourseID int32
// Racecourse is interpreted race course data.
type Racecourse struct {
ID RacecourseID `json:"race_course_id"`
TrackID int32 `json:"race_track_id"`
TrackName string `json:"race_track_name"`
Distance float32 `json:"distance"`
Ground int8 `json:"ground"`
InOut int8 `json:"inout"`
Turn int8 `json:"turn"`
LaneMax TenThousandths `json:"lane_max"`
Threshold1 int8 `json:"threshold1,omitzero"`
Threshold2 int8 `json:"threshold2,omitzero"`
LaneStart [18]TenThousandths `json:"lane_start,omitzero"`
Spans []RacecourseSpan `json:"spans"`
Slopes []Slope `json:"slopes"`
MoveLanePoint float32 `json:"move_lane_point"`
}
// NOTE(zephyr): Racecourse.LaneStart is omitzero so that the JSON field is
// unsoundly undefined when the initial lane type is an unrecognized value.
// That should result in an error in the frontend, rather than a panic in the backend.
// RacecourseSpan is a span of a racecourse, which may be a straight, a corner,
// or a segment of the course which is neither a straight nor a corner.
type RacecourseSpan struct {
// Start is the distance in meters along the track at which the span starts.
Start float32 `json:"start"`
// End is the distance in meters along the track at which the span ends.
End float32 `json:"end"`
// Straight is whether the span is formally a straight.
Straight bool `json:"straight,omitzero"`
// FarStraight is whether the span is the backstretch.
// If true, then Straight is also true.
FarStraight bool `json:"far_straight,omitzero"`
// Corner is the corner number of the span, or zero if not a corner.
Corner int8 `json:"corner,omitzero"`
}
// Slope is a slope segment of a racecourse.
type Slope struct {
Per TenThousandths `json:"per"`
Start float32 `json:"start"`
End float32 `json:"end"`
}
type SaddleID int32
// Saddle is the internal data about a race win saddle.