135 lines
3.0 KiB
Plaintext
135 lines
3.0 KiB
Plaintext
module horse/movement
|
|
|
|
// Surface types.
|
|
pub type surface
|
|
Turf
|
|
Dirt
|
|
|
|
// Automatically generated.
|
|
// Shows a string representation of the `surface` type.
|
|
pub fun surface/show(this : surface) : e string
|
|
match this
|
|
Turf -> "Turf"
|
|
Dirt -> "Dirt"
|
|
|
|
// Race distance types.
|
|
pub type distance
|
|
Sprint
|
|
Mile
|
|
Medium
|
|
Long
|
|
|
|
// Automatically generated.
|
|
// Shows a string representation of the `distance` type.
|
|
pub fun distance/show(this : distance) : e string
|
|
match this
|
|
Sprint -> "Sprint"
|
|
Mile -> "Mile"
|
|
Medium -> "Medium"
|
|
Long -> "Long"
|
|
|
|
// Running styles.
|
|
pub type style
|
|
Front-Runner
|
|
Pace-Chaser
|
|
Late-Surger
|
|
End-Closer
|
|
|
|
// Automatically generated.
|
|
// Equality comparison of the `style` type.
|
|
pub fun style/(==)(this : style, other : style) : e bool
|
|
match (this, other)
|
|
(Front-Runner, Front-Runner) -> True
|
|
(Pace-Chaser, Pace-Chaser) -> True
|
|
(Late-Surger, Late-Surger) -> True
|
|
(End-Closer, End-Closer) -> True
|
|
(_, _) -> False
|
|
|
|
// Shows a string representation of the `style` type.
|
|
pub fun style/show(this : style) : e string
|
|
match this
|
|
Front-Runner -> "Front Runner"
|
|
Pace-Chaser -> "Pace Chaser"
|
|
Late-Surger -> "Late Surger"
|
|
End-Closer -> "End Closer"
|
|
|
|
// Aptitude levels.
|
|
pub type aptitude-level
|
|
G
|
|
F
|
|
E
|
|
D
|
|
C
|
|
B
|
|
A
|
|
S
|
|
|
|
// Get the integer value for an aptitude level, starting at G -> 1.
|
|
pub fun aptitude-level/int(l: aptitude-level): int
|
|
match l
|
|
G -> 1
|
|
F -> 2
|
|
E -> 3
|
|
D -> 4
|
|
C -> 5
|
|
B -> 6
|
|
A -> 7
|
|
S -> 8
|
|
|
|
// Get the aptitude level corresponding to an integer, starting at 1 -> G.
|
|
pub fun int/aptitude-level(l: int): maybe<aptitude-level>
|
|
match l
|
|
1 -> Just(G)
|
|
2 -> Just(F)
|
|
3 -> Just(E)
|
|
4 -> Just(D)
|
|
5 -> Just(C)
|
|
6 -> Just(B)
|
|
7 -> Just(A)
|
|
8 -> Just(S)
|
|
_ -> Nothing
|
|
|
|
// Comparison of the `aptitude-level` type.
|
|
pub fun aptitude-level/cmp(this : aptitude-level, other : aptitude-level) : e order
|
|
cmp(this.int, other.int)
|
|
|
|
// Automatically generated.
|
|
// Fip comparison of the `aptitude-level` type.
|
|
pub fun aptitude-level/order2(this : aptitude-level, other : aptitude-level) : order2<aptitude-level>
|
|
match (this, other)
|
|
(G, G) -> Eq2(G)
|
|
(G, other') -> Lt2(G, other')
|
|
(this', G) -> Gt2(G, this')
|
|
(F, F) -> Eq2(F)
|
|
(F, other') -> Lt2(F, other')
|
|
(this', F) -> Gt2(F, this')
|
|
(E, E) -> Eq2(E)
|
|
(E, other') -> Lt2(E, other')
|
|
(this', E) -> Gt2(E, this')
|
|
(D, D) -> Eq2(D)
|
|
(D, other') -> Lt2(D, other')
|
|
(this', D) -> Gt2(D, this')
|
|
(C, C) -> Eq2(C)
|
|
(C, other') -> Lt2(C, other')
|
|
(this', C) -> Gt2(C, this')
|
|
(B, B) -> Eq2(B)
|
|
(B, other') -> Lt2(B, other')
|
|
(this', B) -> Gt2(B, this')
|
|
(A, A) -> Eq2(A)
|
|
(A, other') -> Lt2(A, other')
|
|
(this', A) -> Gt2(A, this')
|
|
(S, S) -> Eq2(S)
|
|
|
|
// Automatically generated.
|
|
// Shows a string representation of the `aptitude-level` type.
|
|
pub fun aptitude-level/show(this : aptitude-level) : string
|
|
match this
|
|
G -> "G"
|
|
F -> "F"
|
|
E -> "E"
|
|
D -> "D"
|
|
C -> "C"
|
|
B -> "B"
|
|
A -> "A"
|
|
S -> "S"
|