horse: rearrange career race results
This commit is contained in:
@@ -67,29 +67,12 @@ pub fun grade/show(this : grade) : e string
|
||||
G1 -> "G1"
|
||||
EX -> "EX"
|
||||
|
||||
// Graded race that a veteran ran.
|
||||
pub struct race-result
|
||||
// Instance of a race.
|
||||
pub struct race-instance-detail
|
||||
race-instance-id: race-instance-id
|
||||
race-id: race-id
|
||||
place: int
|
||||
turn: turn
|
||||
|
||||
// Automatically generated.
|
||||
// Equality comparison of the `race-result` type.
|
||||
pub fun race-result/(==)(this : race-result, other : race-result) : e bool
|
||||
match (this, other)
|
||||
(Race-result(race, place, turn), Race-result(race', place', turn')) -> race == race' && place == place' && turn == turn'
|
||||
|
||||
// Automatically generated.
|
||||
// Shows a string representation of the `race-result` type.
|
||||
pub fun race-result/show(this : race-result, ?race/show: (race-id) -> string) : e string
|
||||
match this
|
||||
Race-result(race-id, place, turn) -> turn.show ++ " " ++ race-id.show ++ ": " ++ place.show
|
||||
|
||||
// Determine whether two race results are for the same race.
|
||||
// This differs from (==) which also requires the race to be on the same turn.
|
||||
pub fun race-result/same-race(a: race-result, b: race-result): bool
|
||||
a.race-id == b.race-id
|
||||
|
||||
// Turn that a race occurred.
|
||||
pub struct turn
|
||||
year: turn-year
|
||||
|
||||
Reference in New Issue
Block a user