Compare commits
2 Commits
546f2db327
...
c58dbd19b0
| Author | SHA1 | Date | |
|---|---|---|---|
| c58dbd19b0 | |||
| 2fcd608102 |
@@ -10,7 +10,7 @@ This file is my notes from exploring the database.
|
|||||||
- 47 is skill names, 48 is skill descriptions
|
- 47 is skill names, 48 is skill descriptions
|
||||||
- 75 is support card names incl. variant, 76 is support card variant, 77 is support card character
|
- 75 is support card names incl. variant, 76 is support card variant, 77 is support card character
|
||||||
- 147 is spark names, 172 is spark descriptions
|
- 147 is spark names, 172 is spark descriptions
|
||||||
- 33 is race names by race id, 28 is race names by race instance id, 31 is race courses
|
- 33 is race names by race id, 28 is race names by race instance id, 31 is race courses, 111 is saddle names
|
||||||
- 65 is player titles, 66 is title descriptions - ties with honor_data?
|
- 65 is player titles, 66 is title descriptions - ties with honor_data?
|
||||||
|
|
||||||
# succession factor (sparks)
|
# succession factor (sparks)
|
||||||
|
|||||||
@@ -34,15 +34,15 @@ pub struct skill-icon-id
|
|||||||
pub struct race-id
|
pub struct race-id
|
||||||
game-id: game-id
|
game-id: game-id
|
||||||
|
|
||||||
// Game ID for race instances,
|
|
||||||
// i.e. "Tenno Sho (Spring) at Kyoto Racecourse" vs. "Tenno Sho (Spring) at Hanshin."
|
|
||||||
pub struct race-instance-id
|
|
||||||
game-id: game-id
|
|
||||||
|
|
||||||
// Game ID for race thumbnails.
|
// Game ID for race thumbnails.
|
||||||
pub struct race-thumbnail-id
|
pub struct race-thumbnail-id
|
||||||
game-id: game-id
|
game-id: game-id
|
||||||
|
|
||||||
|
// Game ID for saddles,
|
||||||
|
// i.e. one or more race wins that appear as a title.
|
||||||
|
pub struct saddle-id
|
||||||
|
game-id: game-id
|
||||||
|
|
||||||
// order2 comparison between any game ID types.
|
// order2 comparison between any game ID types.
|
||||||
pub inline fun order2(x: a, y: a, ?a/game-id: (a) -> game-id): order2<a>
|
pub inline fun order2(x: a, y: a, ?a/game-id: (a) -> game-id): order2<a>
|
||||||
match x.game-id.cmp(y.game-id)
|
match x.game-id.cmp(y.game-id)
|
||||||
|
|||||||
1091
horse/global/saddle.go
Normal file
1091
horse/global/saddle.go
Normal file
File diff suppressed because it is too large
Load Diff
971
horse/global/saddle.kk
Normal file
971
horse/global/saddle.kk
Normal file
@@ -0,0 +1,971 @@
|
|||||||
|
module horse/global/saddle
|
||||||
|
|
||||||
|
// Automatically generated with horsegen; DO NOT EDIT
|
||||||
|
|
||||||
|
import horse/game-id
|
||||||
|
pub import horse/race
|
||||||
|
pub import horse/global/race
|
||||||
|
|
||||||
|
// Enumeration of all saddles for type-safe programming.
|
||||||
|
pub type saddle
|
||||||
|
Classic-Triple-Crown
|
||||||
|
Senior-Autumn-Triple-Crown
|
||||||
|
Triple-Tiara
|
||||||
|
Senior-Spring-Triple-Crown
|
||||||
|
Tenno-Sweep
|
||||||
|
Dual-Grand-Prix
|
||||||
|
Dual-Miles
|
||||||
|
Dual-Sprints
|
||||||
|
Dual-Dirts
|
||||||
|
Arima-Kinen
|
||||||
|
Japan-C
|
||||||
|
Japanese-Derby
|
||||||
|
Tenno-Sho-Spring
|
||||||
|
Takarazuka-Kinen
|
||||||
|
Tenno-Sho-Autumn
|
||||||
|
Kikuka-Sho
|
||||||
|
Osaka-Hai
|
||||||
|
Satsuki-Sho
|
||||||
|
Japanese-Oaks
|
||||||
|
Takamatsunomiya-Kinen
|
||||||
|
Yasuda-Kinen
|
||||||
|
Sprinters-S
|
||||||
|
Mile-Ch
|
||||||
|
Oka-Sho
|
||||||
|
Victoria-Mile
|
||||||
|
Queen-Elizabeth-II-Cup
|
||||||
|
NHK-Mile-C
|
||||||
|
Shuka-Sho
|
||||||
|
Champions-C
|
||||||
|
February-S
|
||||||
|
JBC-Classic
|
||||||
|
Tokyo-Daishoten
|
||||||
|
Asahi-Hai-FS
|
||||||
|
Hopeful-S
|
||||||
|
Hanshin-JF
|
||||||
|
Teio-Sho
|
||||||
|
JBC-Sprint
|
||||||
|
JD-Derby
|
||||||
|
JBC-L-Classic
|
||||||
|
Nikkei-Shinshun-Hai
|
||||||
|
Tokai-S
|
||||||
|
American-JCC
|
||||||
|
Kyoto-Kinen
|
||||||
|
Nakayama-Kinen
|
||||||
|
Yayoi-Sho
|
||||||
|
Kinko-Sho
|
||||||
|
Fillies-Revue
|
||||||
|
Hanshin-Daishoten
|
||||||
|
Spring-S
|
||||||
|
Nikkei-Sho
|
||||||
|
Hanshin-Umamusume-S
|
||||||
|
New-Zealand-T
|
||||||
|
Yomiuri-Milers-C
|
||||||
|
Flora-S
|
||||||
|
Aoba-Sho
|
||||||
|
Kyoto-Shimbun-Hai
|
||||||
|
Keio-Hai-Spring-C
|
||||||
|
Meguro-Kinen
|
||||||
|
Sapporo-Kinen
|
||||||
|
Centaur-S
|
||||||
|
Rose-S
|
||||||
|
St-Lite-Kinen
|
||||||
|
Kobe-Shimbun-Hai
|
||||||
|
All-Comers
|
||||||
|
Mainichi-Okan
|
||||||
|
Kyoto-Daishoten
|
||||||
|
Fuchu-Umamusume-S
|
||||||
|
Swan-S
|
||||||
|
Keio-Hai-Junior-S
|
||||||
|
Copa-Republica-Argentina
|
||||||
|
Daily-Hai-Junior-S
|
||||||
|
Stayers-S
|
||||||
|
Hanshin-C
|
||||||
|
Kyoto-Kimpai
|
||||||
|
Nakayama-Kimpai
|
||||||
|
Shinzan-Kinen
|
||||||
|
Fairy-S
|
||||||
|
Aichi-Hai
|
||||||
|
Keisei-Hai
|
||||||
|
Silk-Road-S
|
||||||
|
Negishi-S
|
||||||
|
Kisaragi-Sho
|
||||||
|
Tokyo-Shimbun-Hai
|
||||||
|
Queen-C
|
||||||
|
Kyodo-News-Hai
|
||||||
|
Kyoto-Umamusume-S
|
||||||
|
Diamond-S
|
||||||
|
Kokura-Daishoten
|
||||||
|
Arlington-C
|
||||||
|
Hankyu-Hai
|
||||||
|
Tulip-Sho
|
||||||
|
Ocean-S
|
||||||
|
Nakayama-Umamusume-S
|
||||||
|
Falcon-S
|
||||||
|
Flower-C
|
||||||
|
Mainichi-Hai
|
||||||
|
March-S
|
||||||
|
Lord-Derby-CT
|
||||||
|
Antares-S
|
||||||
|
Fukushima-Umamusume-S
|
||||||
|
Niigata-Daishoten
|
||||||
|
Heian-S
|
||||||
|
Naruo-Kinen
|
||||||
|
Mermaid-S
|
||||||
|
Epsom-C
|
||||||
|
Unicorn-S
|
||||||
|
Hakodate-Sprint-S
|
||||||
|
CBC-Sho
|
||||||
|
Radio-Nikkei-Sho
|
||||||
|
Procyon-S
|
||||||
|
Tanabata-Sho
|
||||||
|
Hakodate-Kinen
|
||||||
|
Chukyo-Kinen
|
||||||
|
Hakodate-Junior-S
|
||||||
|
Ibis-Summer-D
|
||||||
|
Queen-S
|
||||||
|
Kokura-Kinen
|
||||||
|
Leopard-S
|
||||||
|
Sekiya-Kinen
|
||||||
|
Elm-S
|
||||||
|
Kitakyushu-Kinen
|
||||||
|
Niigata-Junior-S
|
||||||
|
Keeneland-C
|
||||||
|
Sapporo-Junior-S
|
||||||
|
Kokura-Junior-S
|
||||||
|
Niigata-Kinen
|
||||||
|
Shion-S
|
||||||
|
Keisei-Hai-AH
|
||||||
|
Sirius-S
|
||||||
|
Saudi-Arabia-RC
|
||||||
|
Fuji-S
|
||||||
|
Artemis-S
|
||||||
|
Fantasy-S
|
||||||
|
Miyako-S
|
||||||
|
Musashino-S
|
||||||
|
Fukushima-Kinen
|
||||||
|
Tokyo-Sports-Hai-Junior-S
|
||||||
|
Kyoto-Junior-S
|
||||||
|
Keihan-Hai
|
||||||
|
Challenge-C
|
||||||
|
Chunichi-Shimbun-Hai
|
||||||
|
Capella-S
|
||||||
|
Turquoise-S
|
||||||
|
Classic-Triple-Crown-Alt1
|
||||||
|
Senior-Spring-Triple-Crown-Alt1
|
||||||
|
Dual-Grand-Prix-Alt1
|
||||||
|
Takarazuka-Kinen-Alt1
|
||||||
|
Kikuka-Sho-Alt1
|
||||||
|
Spring-S-Alt1
|
||||||
|
Aoi-S
|
||||||
|
Senior-Spring-Triple-Crown-Alt2
|
||||||
|
Tenno-Sweep-Alt1
|
||||||
|
Tenno-Sho-Spring-Alt1
|
||||||
|
|
||||||
|
// Get the saddle ID for a saddle.
|
||||||
|
pub fun saddle-id(s: saddle): saddle-id
|
||||||
|
match s
|
||||||
|
Classic-Triple-Crown -> Saddle-id(1)
|
||||||
|
Senior-Autumn-Triple-Crown -> Saddle-id(2)
|
||||||
|
Triple-Tiara -> Saddle-id(3)
|
||||||
|
Senior-Spring-Triple-Crown -> Saddle-id(4)
|
||||||
|
Tenno-Sweep -> Saddle-id(5)
|
||||||
|
Dual-Grand-Prix -> Saddle-id(6)
|
||||||
|
Dual-Miles -> Saddle-id(7)
|
||||||
|
Dual-Sprints -> Saddle-id(8)
|
||||||
|
Dual-Dirts -> Saddle-id(9)
|
||||||
|
Arima-Kinen -> Saddle-id(10)
|
||||||
|
Japan-C -> Saddle-id(11)
|
||||||
|
Japanese-Derby -> Saddle-id(12)
|
||||||
|
Tenno-Sho-Spring -> Saddle-id(13)
|
||||||
|
Takarazuka-Kinen -> Saddle-id(14)
|
||||||
|
Tenno-Sho-Autumn -> Saddle-id(15)
|
||||||
|
Kikuka-Sho -> Saddle-id(16)
|
||||||
|
Osaka-Hai -> Saddle-id(17)
|
||||||
|
Satsuki-Sho -> Saddle-id(18)
|
||||||
|
Japanese-Oaks -> Saddle-id(19)
|
||||||
|
Takamatsunomiya-Kinen -> Saddle-id(20)
|
||||||
|
Yasuda-Kinen -> Saddle-id(21)
|
||||||
|
Sprinters-S -> Saddle-id(22)
|
||||||
|
Mile-Ch -> Saddle-id(23)
|
||||||
|
Oka-Sho -> Saddle-id(24)
|
||||||
|
Victoria-Mile -> Saddle-id(25)
|
||||||
|
Queen-Elizabeth-II-Cup -> Saddle-id(26)
|
||||||
|
NHK-Mile-C -> Saddle-id(27)
|
||||||
|
Shuka-Sho -> Saddle-id(28)
|
||||||
|
Champions-C -> Saddle-id(29)
|
||||||
|
February-S -> Saddle-id(30)
|
||||||
|
JBC-Classic -> Saddle-id(31)
|
||||||
|
Tokyo-Daishoten -> Saddle-id(32)
|
||||||
|
Asahi-Hai-FS -> Saddle-id(33)
|
||||||
|
Hopeful-S -> Saddle-id(34)
|
||||||
|
Hanshin-JF -> Saddle-id(35)
|
||||||
|
Teio-Sho -> Saddle-id(36)
|
||||||
|
JBC-Sprint -> Saddle-id(37)
|
||||||
|
JD-Derby -> Saddle-id(38)
|
||||||
|
JBC-L-Classic -> Saddle-id(39)
|
||||||
|
Nikkei-Shinshun-Hai -> Saddle-id(40)
|
||||||
|
Tokai-S -> Saddle-id(41)
|
||||||
|
American-JCC -> Saddle-id(42)
|
||||||
|
Kyoto-Kinen -> Saddle-id(43)
|
||||||
|
Nakayama-Kinen -> Saddle-id(44)
|
||||||
|
Yayoi-Sho -> Saddle-id(45)
|
||||||
|
Kinko-Sho -> Saddle-id(46)
|
||||||
|
Fillies-Revue -> Saddle-id(47)
|
||||||
|
Hanshin-Daishoten -> Saddle-id(48)
|
||||||
|
Spring-S -> Saddle-id(49)
|
||||||
|
Nikkei-Sho -> Saddle-id(50)
|
||||||
|
Hanshin-Umamusume-S -> Saddle-id(51)
|
||||||
|
New-Zealand-T -> Saddle-id(52)
|
||||||
|
Yomiuri-Milers-C -> Saddle-id(53)
|
||||||
|
Flora-S -> Saddle-id(54)
|
||||||
|
Aoba-Sho -> Saddle-id(55)
|
||||||
|
Kyoto-Shimbun-Hai -> Saddle-id(56)
|
||||||
|
Keio-Hai-Spring-C -> Saddle-id(57)
|
||||||
|
Meguro-Kinen -> Saddle-id(58)
|
||||||
|
Sapporo-Kinen -> Saddle-id(59)
|
||||||
|
Centaur-S -> Saddle-id(60)
|
||||||
|
Rose-S -> Saddle-id(61)
|
||||||
|
St-Lite-Kinen -> Saddle-id(62)
|
||||||
|
Kobe-Shimbun-Hai -> Saddle-id(63)
|
||||||
|
All-Comers -> Saddle-id(64)
|
||||||
|
Mainichi-Okan -> Saddle-id(65)
|
||||||
|
Kyoto-Daishoten -> Saddle-id(66)
|
||||||
|
Fuchu-Umamusume-S -> Saddle-id(67)
|
||||||
|
Swan-S -> Saddle-id(68)
|
||||||
|
Keio-Hai-Junior-S -> Saddle-id(69)
|
||||||
|
Copa-Republica-Argentina -> Saddle-id(70)
|
||||||
|
Daily-Hai-Junior-S -> Saddle-id(71)
|
||||||
|
Stayers-S -> Saddle-id(72)
|
||||||
|
Hanshin-C -> Saddle-id(73)
|
||||||
|
Kyoto-Kimpai -> Saddle-id(74)
|
||||||
|
Nakayama-Kimpai -> Saddle-id(75)
|
||||||
|
Shinzan-Kinen -> Saddle-id(76)
|
||||||
|
Fairy-S -> Saddle-id(77)
|
||||||
|
Aichi-Hai -> Saddle-id(78)
|
||||||
|
Keisei-Hai -> Saddle-id(79)
|
||||||
|
Silk-Road-S -> Saddle-id(80)
|
||||||
|
Negishi-S -> Saddle-id(81)
|
||||||
|
Kisaragi-Sho -> Saddle-id(82)
|
||||||
|
Tokyo-Shimbun-Hai -> Saddle-id(83)
|
||||||
|
Queen-C -> Saddle-id(84)
|
||||||
|
Kyodo-News-Hai -> Saddle-id(85)
|
||||||
|
Kyoto-Umamusume-S -> Saddle-id(86)
|
||||||
|
Diamond-S -> Saddle-id(87)
|
||||||
|
Kokura-Daishoten -> Saddle-id(88)
|
||||||
|
Arlington-C -> Saddle-id(89)
|
||||||
|
Hankyu-Hai -> Saddle-id(90)
|
||||||
|
Tulip-Sho -> Saddle-id(91)
|
||||||
|
Ocean-S -> Saddle-id(92)
|
||||||
|
Nakayama-Umamusume-S -> Saddle-id(93)
|
||||||
|
Falcon-S -> Saddle-id(94)
|
||||||
|
Flower-C -> Saddle-id(95)
|
||||||
|
Mainichi-Hai -> Saddle-id(96)
|
||||||
|
March-S -> Saddle-id(97)
|
||||||
|
Lord-Derby-CT -> Saddle-id(98)
|
||||||
|
Antares-S -> Saddle-id(99)
|
||||||
|
Fukushima-Umamusume-S -> Saddle-id(100)
|
||||||
|
Niigata-Daishoten -> Saddle-id(101)
|
||||||
|
Heian-S -> Saddle-id(102)
|
||||||
|
Naruo-Kinen -> Saddle-id(103)
|
||||||
|
Mermaid-S -> Saddle-id(104)
|
||||||
|
Epsom-C -> Saddle-id(105)
|
||||||
|
Unicorn-S -> Saddle-id(106)
|
||||||
|
Hakodate-Sprint-S -> Saddle-id(107)
|
||||||
|
CBC-Sho -> Saddle-id(108)
|
||||||
|
Radio-Nikkei-Sho -> Saddle-id(109)
|
||||||
|
Procyon-S -> Saddle-id(110)
|
||||||
|
Tanabata-Sho -> Saddle-id(111)
|
||||||
|
Hakodate-Kinen -> Saddle-id(112)
|
||||||
|
Chukyo-Kinen -> Saddle-id(113)
|
||||||
|
Hakodate-Junior-S -> Saddle-id(114)
|
||||||
|
Ibis-Summer-D -> Saddle-id(115)
|
||||||
|
Queen-S -> Saddle-id(116)
|
||||||
|
Kokura-Kinen -> Saddle-id(117)
|
||||||
|
Leopard-S -> Saddle-id(118)
|
||||||
|
Sekiya-Kinen -> Saddle-id(119)
|
||||||
|
Elm-S -> Saddle-id(120)
|
||||||
|
Kitakyushu-Kinen -> Saddle-id(121)
|
||||||
|
Niigata-Junior-S -> Saddle-id(122)
|
||||||
|
Keeneland-C -> Saddle-id(123)
|
||||||
|
Sapporo-Junior-S -> Saddle-id(124)
|
||||||
|
Kokura-Junior-S -> Saddle-id(125)
|
||||||
|
Niigata-Kinen -> Saddle-id(126)
|
||||||
|
Shion-S -> Saddle-id(127)
|
||||||
|
Keisei-Hai-AH -> Saddle-id(128)
|
||||||
|
Sirius-S -> Saddle-id(129)
|
||||||
|
Saudi-Arabia-RC -> Saddle-id(130)
|
||||||
|
Fuji-S -> Saddle-id(131)
|
||||||
|
Artemis-S -> Saddle-id(132)
|
||||||
|
Fantasy-S -> Saddle-id(133)
|
||||||
|
Miyako-S -> Saddle-id(134)
|
||||||
|
Musashino-S -> Saddle-id(135)
|
||||||
|
Fukushima-Kinen -> Saddle-id(136)
|
||||||
|
Tokyo-Sports-Hai-Junior-S -> Saddle-id(137)
|
||||||
|
Kyoto-Junior-S -> Saddle-id(138)
|
||||||
|
Keihan-Hai -> Saddle-id(139)
|
||||||
|
Challenge-C -> Saddle-id(140)
|
||||||
|
Chunichi-Shimbun-Hai -> Saddle-id(141)
|
||||||
|
Capella-S -> Saddle-id(142)
|
||||||
|
Turquoise-S -> Saddle-id(143)
|
||||||
|
Classic-Triple-Crown-Alt1 -> Saddle-id(144)
|
||||||
|
Senior-Spring-Triple-Crown-Alt1 -> Saddle-id(145)
|
||||||
|
Dual-Grand-Prix-Alt1 -> Saddle-id(146)
|
||||||
|
Takarazuka-Kinen-Alt1 -> Saddle-id(147)
|
||||||
|
Kikuka-Sho-Alt1 -> Saddle-id(148)
|
||||||
|
Spring-S-Alt1 -> Saddle-id(149)
|
||||||
|
Aoi-S -> Saddle-id(150)
|
||||||
|
Senior-Spring-Triple-Crown-Alt2 -> Saddle-id(151)
|
||||||
|
Tenno-Sweep-Alt1 -> Saddle-id(152)
|
||||||
|
Tenno-Sho-Spring-Alt1 -> Saddle-id(153)
|
||||||
|
|
||||||
|
// List of all saddles in ID order for easy iterating.
|
||||||
|
pub val all = [
|
||||||
|
Classic-Triple-Crown,
|
||||||
|
Senior-Autumn-Triple-Crown,
|
||||||
|
Triple-Tiara,
|
||||||
|
Senior-Spring-Triple-Crown,
|
||||||
|
Tenno-Sweep,
|
||||||
|
Dual-Grand-Prix,
|
||||||
|
Dual-Miles,
|
||||||
|
Dual-Sprints,
|
||||||
|
Dual-Dirts,
|
||||||
|
Arima-Kinen,
|
||||||
|
Japan-C,
|
||||||
|
Japanese-Derby,
|
||||||
|
Tenno-Sho-Spring,
|
||||||
|
Takarazuka-Kinen,
|
||||||
|
Tenno-Sho-Autumn,
|
||||||
|
Kikuka-Sho,
|
||||||
|
Osaka-Hai,
|
||||||
|
Satsuki-Sho,
|
||||||
|
Japanese-Oaks,
|
||||||
|
Takamatsunomiya-Kinen,
|
||||||
|
Yasuda-Kinen,
|
||||||
|
Sprinters-S,
|
||||||
|
Mile-Ch,
|
||||||
|
Oka-Sho,
|
||||||
|
Victoria-Mile,
|
||||||
|
Queen-Elizabeth-II-Cup,
|
||||||
|
NHK-Mile-C,
|
||||||
|
Shuka-Sho,
|
||||||
|
Champions-C,
|
||||||
|
February-S,
|
||||||
|
JBC-Classic,
|
||||||
|
Tokyo-Daishoten,
|
||||||
|
Asahi-Hai-FS,
|
||||||
|
Hopeful-S,
|
||||||
|
Hanshin-JF,
|
||||||
|
Teio-Sho,
|
||||||
|
JBC-Sprint,
|
||||||
|
JD-Derby,
|
||||||
|
JBC-L-Classic,
|
||||||
|
Nikkei-Shinshun-Hai,
|
||||||
|
Tokai-S,
|
||||||
|
American-JCC,
|
||||||
|
Kyoto-Kinen,
|
||||||
|
Nakayama-Kinen,
|
||||||
|
Yayoi-Sho,
|
||||||
|
Kinko-Sho,
|
||||||
|
Fillies-Revue,
|
||||||
|
Hanshin-Daishoten,
|
||||||
|
Spring-S,
|
||||||
|
Nikkei-Sho,
|
||||||
|
Hanshin-Umamusume-S,
|
||||||
|
New-Zealand-T,
|
||||||
|
Yomiuri-Milers-C,
|
||||||
|
Flora-S,
|
||||||
|
Aoba-Sho,
|
||||||
|
Kyoto-Shimbun-Hai,
|
||||||
|
Keio-Hai-Spring-C,
|
||||||
|
Meguro-Kinen,
|
||||||
|
Sapporo-Kinen,
|
||||||
|
Centaur-S,
|
||||||
|
Rose-S,
|
||||||
|
St-Lite-Kinen,
|
||||||
|
Kobe-Shimbun-Hai,
|
||||||
|
All-Comers,
|
||||||
|
Mainichi-Okan,
|
||||||
|
Kyoto-Daishoten,
|
||||||
|
Fuchu-Umamusume-S,
|
||||||
|
Swan-S,
|
||||||
|
Keio-Hai-Junior-S,
|
||||||
|
Copa-Republica-Argentina,
|
||||||
|
Daily-Hai-Junior-S,
|
||||||
|
Stayers-S,
|
||||||
|
Hanshin-C,
|
||||||
|
Kyoto-Kimpai,
|
||||||
|
Nakayama-Kimpai,
|
||||||
|
Shinzan-Kinen,
|
||||||
|
Fairy-S,
|
||||||
|
Aichi-Hai,
|
||||||
|
Keisei-Hai,
|
||||||
|
Silk-Road-S,
|
||||||
|
Negishi-S,
|
||||||
|
Kisaragi-Sho,
|
||||||
|
Tokyo-Shimbun-Hai,
|
||||||
|
Queen-C,
|
||||||
|
Kyodo-News-Hai,
|
||||||
|
Kyoto-Umamusume-S,
|
||||||
|
Diamond-S,
|
||||||
|
Kokura-Daishoten,
|
||||||
|
Arlington-C,
|
||||||
|
Hankyu-Hai,
|
||||||
|
Tulip-Sho,
|
||||||
|
Ocean-S,
|
||||||
|
Nakayama-Umamusume-S,
|
||||||
|
Falcon-S,
|
||||||
|
Flower-C,
|
||||||
|
Mainichi-Hai,
|
||||||
|
March-S,
|
||||||
|
Lord-Derby-CT,
|
||||||
|
Antares-S,
|
||||||
|
Fukushima-Umamusume-S,
|
||||||
|
Niigata-Daishoten,
|
||||||
|
Heian-S,
|
||||||
|
Naruo-Kinen,
|
||||||
|
Mermaid-S,
|
||||||
|
Epsom-C,
|
||||||
|
Unicorn-S,
|
||||||
|
Hakodate-Sprint-S,
|
||||||
|
CBC-Sho,
|
||||||
|
Radio-Nikkei-Sho,
|
||||||
|
Procyon-S,
|
||||||
|
Tanabata-Sho,
|
||||||
|
Hakodate-Kinen,
|
||||||
|
Chukyo-Kinen,
|
||||||
|
Hakodate-Junior-S,
|
||||||
|
Ibis-Summer-D,
|
||||||
|
Queen-S,
|
||||||
|
Kokura-Kinen,
|
||||||
|
Leopard-S,
|
||||||
|
Sekiya-Kinen,
|
||||||
|
Elm-S,
|
||||||
|
Kitakyushu-Kinen,
|
||||||
|
Niigata-Junior-S,
|
||||||
|
Keeneland-C,
|
||||||
|
Sapporo-Junior-S,
|
||||||
|
Kokura-Junior-S,
|
||||||
|
Niigata-Kinen,
|
||||||
|
Shion-S,
|
||||||
|
Keisei-Hai-AH,
|
||||||
|
Sirius-S,
|
||||||
|
Saudi-Arabia-RC,
|
||||||
|
Fuji-S,
|
||||||
|
Artemis-S,
|
||||||
|
Fantasy-S,
|
||||||
|
Miyako-S,
|
||||||
|
Musashino-S,
|
||||||
|
Fukushima-Kinen,
|
||||||
|
Tokyo-Sports-Hai-Junior-S,
|
||||||
|
Kyoto-Junior-S,
|
||||||
|
Keihan-Hai,
|
||||||
|
Challenge-C,
|
||||||
|
Chunichi-Shimbun-Hai,
|
||||||
|
Capella-S,
|
||||||
|
Turquoise-S,
|
||||||
|
Classic-Triple-Crown-Alt1,
|
||||||
|
Senior-Spring-Triple-Crown-Alt1,
|
||||||
|
Dual-Grand-Prix-Alt1,
|
||||||
|
Takarazuka-Kinen-Alt1,
|
||||||
|
Kikuka-Sho-Alt1,
|
||||||
|
Spring-S-Alt1,
|
||||||
|
Aoi-S,
|
||||||
|
Senior-Spring-Triple-Crown-Alt2,
|
||||||
|
Tenno-Sweep-Alt1,
|
||||||
|
Tenno-Sho-Spring-Alt1,
|
||||||
|
]
|
||||||
|
|
||||||
|
// Get the name for a saddle.
|
||||||
|
// Alternate versions of saddles have an indication of such in their names.
|
||||||
|
// If no saddle matches the ID, the result contains the numeric ID.
|
||||||
|
pub fun show(s: saddle-id): string
|
||||||
|
match s.game-id
|
||||||
|
1 -> "Classic Triple Crown"
|
||||||
|
2 -> "Senior Autumn Triple Crown"
|
||||||
|
3 -> "Triple Tiara"
|
||||||
|
4 -> "Senior Spring Triple Crown"
|
||||||
|
5 -> "Tenno Sweep"
|
||||||
|
6 -> "Dual Grand Prix"
|
||||||
|
7 -> "Dual Miles"
|
||||||
|
8 -> "Dual Sprints"
|
||||||
|
9 -> "Dual Dirts"
|
||||||
|
10 -> "Arima Kinen"
|
||||||
|
11 -> "Japan C."
|
||||||
|
12 -> "Japanese Derby"
|
||||||
|
13 -> "Tenno Sho (Spring)"
|
||||||
|
14 -> "Takarazuka Kinen"
|
||||||
|
15 -> "Tenno Sho (Autumn)"
|
||||||
|
16 -> "Kikuka Sho"
|
||||||
|
17 -> "Osaka Hai"
|
||||||
|
18 -> "Satsuki Sho"
|
||||||
|
19 -> "Japanese Oaks"
|
||||||
|
20 -> "Takamatsunomiya Kinen"
|
||||||
|
21 -> "Yasuda Kinen"
|
||||||
|
22 -> "Sprinters S."
|
||||||
|
23 -> "Mile Ch."
|
||||||
|
24 -> "Oka Sho"
|
||||||
|
25 -> "Victoria Mile"
|
||||||
|
26 -> "Queen Elizabeth II Cup"
|
||||||
|
27 -> "NHK Mile C."
|
||||||
|
28 -> "Shuka Sho"
|
||||||
|
29 -> "Champions C."
|
||||||
|
30 -> "February S."
|
||||||
|
31 -> "JBC Classic"
|
||||||
|
32 -> "Tokyo Daishoten"
|
||||||
|
33 -> "Asahi Hai F.S."
|
||||||
|
34 -> "Hopeful S."
|
||||||
|
35 -> "Hanshin J.F."
|
||||||
|
36 -> "Teio Sho"
|
||||||
|
37 -> "JBC Sprint"
|
||||||
|
38 -> "J.D. Derby"
|
||||||
|
39 -> "JBC L. Classic"
|
||||||
|
40 -> "Nikkei Shinshun Hai"
|
||||||
|
41 -> "Tokai S."
|
||||||
|
42 -> "American JCC"
|
||||||
|
43 -> "Kyoto Kinen"
|
||||||
|
44 -> "Nakayama Kinen"
|
||||||
|
45 -> "Yayoi Sho"
|
||||||
|
46 -> "Kinko Sho"
|
||||||
|
47 -> "Fillies' Revue"
|
||||||
|
48 -> "Hanshin Daishoten"
|
||||||
|
49 -> "Spring S."
|
||||||
|
50 -> "Nikkei Sho"
|
||||||
|
51 -> "Hanshin Umamusume S."
|
||||||
|
52 -> "New Zealand T."
|
||||||
|
53 -> "Yomiuri Milers C."
|
||||||
|
54 -> "Flora S."
|
||||||
|
55 -> "Aoba Sho"
|
||||||
|
56 -> "Kyoto Shimbun Hai"
|
||||||
|
57 -> "Keio Hai Spring C."
|
||||||
|
58 -> "Meguro Kinen"
|
||||||
|
59 -> "Sapporo Kinen"
|
||||||
|
60 -> "Centaur S."
|
||||||
|
61 -> "Rose S."
|
||||||
|
62 -> "St. Lite Kinen"
|
||||||
|
63 -> "Kobe Shimbun Hai"
|
||||||
|
64 -> "All Comers"
|
||||||
|
65 -> "Mainichi Okan"
|
||||||
|
66 -> "Kyoto Daishoten"
|
||||||
|
67 -> "Fuchu Umamusume S."
|
||||||
|
68 -> "Swan S."
|
||||||
|
69 -> "Keio Hai Junior S."
|
||||||
|
70 -> "Copa Republica Argentina"
|
||||||
|
71 -> "Daily Hai Junior S."
|
||||||
|
72 -> "Stayers S."
|
||||||
|
73 -> "Hanshin C."
|
||||||
|
74 -> "Kyoto Kimpai"
|
||||||
|
75 -> "Nakayama Kimpai"
|
||||||
|
76 -> "Shinzan Kinen"
|
||||||
|
77 -> "Fairy S."
|
||||||
|
78 -> "Aichi Hai"
|
||||||
|
79 -> "Keisei Hai"
|
||||||
|
80 -> "Silk Road S."
|
||||||
|
81 -> "Negishi S."
|
||||||
|
82 -> "Kisaragi Sho"
|
||||||
|
83 -> "Tokyo Shimbun Hai"
|
||||||
|
84 -> "Queen C."
|
||||||
|
85 -> "Kyodo News Hai"
|
||||||
|
86 -> "Kyoto Umamusume S."
|
||||||
|
87 -> "Diamond S."
|
||||||
|
88 -> "Kokura Daishoten"
|
||||||
|
89 -> "Arlington C."
|
||||||
|
90 -> "Hankyu Hai"
|
||||||
|
91 -> "Tulip Sho"
|
||||||
|
92 -> "Ocean S."
|
||||||
|
93 -> "Nakayama Umamusume S."
|
||||||
|
94 -> "Falcon S."
|
||||||
|
95 -> "Flower C."
|
||||||
|
96 -> "Mainichi Hai"
|
||||||
|
97 -> "March S."
|
||||||
|
98 -> "Lord Derby C.T."
|
||||||
|
99 -> "Antares S."
|
||||||
|
100 -> "Fukushima Umamusume S."
|
||||||
|
101 -> "Niigata Daishoten"
|
||||||
|
102 -> "Heian S."
|
||||||
|
103 -> "Naruo Kinen"
|
||||||
|
104 -> "Mermaid S."
|
||||||
|
105 -> "Epsom C."
|
||||||
|
106 -> "Unicorn S."
|
||||||
|
107 -> "Hakodate Sprint S."
|
||||||
|
108 -> "CBC Sho"
|
||||||
|
109 -> "Radio Nikkei Sho"
|
||||||
|
110 -> "Procyon S."
|
||||||
|
111 -> "Tanabata Sho"
|
||||||
|
112 -> "Hakodate Kinen"
|
||||||
|
113 -> "Chukyo Kinen"
|
||||||
|
114 -> "Hakodate Junior S."
|
||||||
|
115 -> "Ibis Summer D."
|
||||||
|
116 -> "Queen S."
|
||||||
|
117 -> "Kokura Kinen"
|
||||||
|
118 -> "Leopard S."
|
||||||
|
119 -> "Sekiya Kinen"
|
||||||
|
120 -> "Elm S."
|
||||||
|
121 -> "Kitakyushu Kinen"
|
||||||
|
122 -> "Niigata Junior S."
|
||||||
|
123 -> "Keeneland C."
|
||||||
|
124 -> "Sapporo Junior S."
|
||||||
|
125 -> "Kokura Junior S."
|
||||||
|
126 -> "Niigata Kinen"
|
||||||
|
127 -> "Shion S."
|
||||||
|
128 -> "Keisei Hai A.H."
|
||||||
|
129 -> "Sirius S."
|
||||||
|
130 -> "Saudi Arabia R.C."
|
||||||
|
131 -> "Fuji S."
|
||||||
|
132 -> "Artemis S."
|
||||||
|
133 -> "Fantasy S."
|
||||||
|
134 -> "Miyako S."
|
||||||
|
135 -> "Musashino S."
|
||||||
|
136 -> "Fukushima Kinen"
|
||||||
|
137 -> "Tokyo Sports Hai Junior S."
|
||||||
|
138 -> "Kyoto Junior S."
|
||||||
|
139 -> "Keihan Hai"
|
||||||
|
140 -> "Challenge C."
|
||||||
|
141 -> "Chunichi Shimbun Hai"
|
||||||
|
142 -> "Capella S."
|
||||||
|
143 -> "Turquoise S."
|
||||||
|
144 -> "Classic Triple Crown" ++ " (Alternate 1)"
|
||||||
|
145 -> "Senior Spring Triple Crown" ++ " (Alternate 1)"
|
||||||
|
146 -> "Dual Grand Prix" ++ " (Alternate 1)"
|
||||||
|
147 -> "Takarazuka Kinen" ++ " (Alternate 1)"
|
||||||
|
148 -> "Kikuka Sho" ++ " (Alternate 1)"
|
||||||
|
149 -> "Spring S." ++ " (Alternate 1)"
|
||||||
|
150 -> "Aoi S."
|
||||||
|
151 -> "Senior Spring Triple Crown" ++ " (Alternate 2)"
|
||||||
|
152 -> "Tenno Sweep" ++ " (Alternate 1)"
|
||||||
|
153 -> "Tenno Sho (Spring)" ++ " (Alternate 1)"
|
||||||
|
x -> "saddle " ++ x.show
|
||||||
|
|
||||||
|
// Get the list of races that entitle a horse to a saddle.
|
||||||
|
// If no saddle matches the ID, the result is the empty list.
|
||||||
|
pub fun races(s: saddle-id): list<race-id>
|
||||||
|
match s.game-id
|
||||||
|
1 -> [Race-id(100501), Race-id(101001), Race-id(101501), ]
|
||||||
|
2 -> [Race-id(101601), Race-id(101901), Race-id(102301), ]
|
||||||
|
3 -> [Race-id(100401), Race-id(100901), Race-id(101401), ]
|
||||||
|
4 -> [Race-id(100301), Race-id(100601), Race-id(101201), ]
|
||||||
|
5 -> [Race-id(100601), Race-id(101601), ]
|
||||||
|
6 -> [Race-id(101201), Race-id(102301), ]
|
||||||
|
7 -> [Race-id(101101), Race-id(101801), ]
|
||||||
|
8 -> [Race-id(101301), Race-id(100201), ]
|
||||||
|
9 -> [Race-id(100101), Race-id(102001), ]
|
||||||
|
10 -> [Race-id(102301), ]
|
||||||
|
11 -> [Race-id(101901), ]
|
||||||
|
12 -> [Race-id(101001), ]
|
||||||
|
13 -> [Race-id(100601), ]
|
||||||
|
14 -> [Race-id(101201), ]
|
||||||
|
15 -> [Race-id(101601), ]
|
||||||
|
16 -> [Race-id(101501), ]
|
||||||
|
17 -> [Race-id(100301), ]
|
||||||
|
18 -> [Race-id(100501), ]
|
||||||
|
19 -> [Race-id(100901), ]
|
||||||
|
20 -> [Race-id(100201), ]
|
||||||
|
21 -> [Race-id(101101), ]
|
||||||
|
22 -> [Race-id(101301), ]
|
||||||
|
23 -> [Race-id(101801), ]
|
||||||
|
24 -> [Race-id(100401), ]
|
||||||
|
25 -> [Race-id(100801), ]
|
||||||
|
26 -> [Race-id(101701), ]
|
||||||
|
27 -> [Race-id(100701), ]
|
||||||
|
28 -> [Race-id(101401), ]
|
||||||
|
29 -> [Race-id(102001), ]
|
||||||
|
30 -> [Race-id(100101), ]
|
||||||
|
31 -> [Race-id(110501), ]
|
||||||
|
32 -> [Race-id(110601), ]
|
||||||
|
33 -> [Race-id(102201), ]
|
||||||
|
34 -> [Race-id(102401), ]
|
||||||
|
35 -> [Race-id(102101), ]
|
||||||
|
36 -> [Race-id(110101), ]
|
||||||
|
37 -> [Race-id(110401), ]
|
||||||
|
38 -> [Race-id(110201), ]
|
||||||
|
39 -> [Race-id(110301), ]
|
||||||
|
40 -> [Race-id(200101), ]
|
||||||
|
41 -> [Race-id(200201), ]
|
||||||
|
42 -> [Race-id(200301), ]
|
||||||
|
43 -> [Race-id(200401), ]
|
||||||
|
44 -> [Race-id(200501), ]
|
||||||
|
45 -> [Race-id(200601), ]
|
||||||
|
46 -> [Race-id(200701), ]
|
||||||
|
47 -> [Race-id(200801), ]
|
||||||
|
48 -> [Race-id(200901), ]
|
||||||
|
49 -> [Race-id(201001), ]
|
||||||
|
50 -> [Race-id(201101), ]
|
||||||
|
51 -> [Race-id(201201), ]
|
||||||
|
52 -> [Race-id(201301), ]
|
||||||
|
53 -> [Race-id(201401), ]
|
||||||
|
54 -> [Race-id(201501), ]
|
||||||
|
55 -> [Race-id(201601), ]
|
||||||
|
56 -> [Race-id(201701), ]
|
||||||
|
57 -> [Race-id(201801), ]
|
||||||
|
58 -> [Race-id(201901), ]
|
||||||
|
59 -> [Race-id(202001), ]
|
||||||
|
60 -> [Race-id(202101), ]
|
||||||
|
61 -> [Race-id(202201), ]
|
||||||
|
62 -> [Race-id(202301), ]
|
||||||
|
63 -> [Race-id(202401), ]
|
||||||
|
64 -> [Race-id(202501), ]
|
||||||
|
65 -> [Race-id(202601), ]
|
||||||
|
66 -> [Race-id(202701), ]
|
||||||
|
67 -> [Race-id(202801), ]
|
||||||
|
68 -> [Race-id(202901), ]
|
||||||
|
69 -> [Race-id(203001), ]
|
||||||
|
70 -> [Race-id(203101), ]
|
||||||
|
71 -> [Race-id(203201), ]
|
||||||
|
72 -> [Race-id(203301), ]
|
||||||
|
73 -> [Race-id(203401), ]
|
||||||
|
74 -> [Race-id(300101), ]
|
||||||
|
75 -> [Race-id(300201), ]
|
||||||
|
76 -> [Race-id(300301), ]
|
||||||
|
77 -> [Race-id(300401), ]
|
||||||
|
78 -> [Race-id(300501), ]
|
||||||
|
79 -> [Race-id(300601), ]
|
||||||
|
80 -> [Race-id(300701), ]
|
||||||
|
81 -> [Race-id(300801), ]
|
||||||
|
82 -> [Race-id(300901), ]
|
||||||
|
83 -> [Race-id(301001), ]
|
||||||
|
84 -> [Race-id(301101), ]
|
||||||
|
85 -> [Race-id(301201), ]
|
||||||
|
86 -> [Race-id(301301), ]
|
||||||
|
87 -> [Race-id(301401), ]
|
||||||
|
88 -> [Race-id(301501), ]
|
||||||
|
89 -> [Race-id(301601), ]
|
||||||
|
90 -> [Race-id(301701), ]
|
||||||
|
91 -> [Race-id(301801), ]
|
||||||
|
92 -> [Race-id(301901), ]
|
||||||
|
93 -> [Race-id(302001), ]
|
||||||
|
94 -> [Race-id(302101), ]
|
||||||
|
95 -> [Race-id(302201), ]
|
||||||
|
96 -> [Race-id(302301), ]
|
||||||
|
97 -> [Race-id(302401), ]
|
||||||
|
98 -> [Race-id(302501), ]
|
||||||
|
99 -> [Race-id(302601), ]
|
||||||
|
100 -> [Race-id(302701), ]
|
||||||
|
101 -> [Race-id(302801), ]
|
||||||
|
102 -> [Race-id(302901), ]
|
||||||
|
103 -> [Race-id(303001), ]
|
||||||
|
104 -> [Race-id(303101), ]
|
||||||
|
105 -> [Race-id(303201), ]
|
||||||
|
106 -> [Race-id(303301), ]
|
||||||
|
107 -> [Race-id(303401), ]
|
||||||
|
108 -> [Race-id(303501), ]
|
||||||
|
109 -> [Race-id(303601), ]
|
||||||
|
110 -> [Race-id(303701), ]
|
||||||
|
111 -> [Race-id(303801), ]
|
||||||
|
112 -> [Race-id(303901), ]
|
||||||
|
113 -> [Race-id(304001), ]
|
||||||
|
114 -> [Race-id(304101), ]
|
||||||
|
115 -> [Race-id(304201), ]
|
||||||
|
116 -> [Race-id(304301), ]
|
||||||
|
117 -> [Race-id(304401), ]
|
||||||
|
118 -> [Race-id(304501), ]
|
||||||
|
119 -> [Race-id(304601), ]
|
||||||
|
120 -> [Race-id(304701), ]
|
||||||
|
121 -> [Race-id(304801), ]
|
||||||
|
122 -> [Race-id(304901), ]
|
||||||
|
123 -> [Race-id(305001), ]
|
||||||
|
124 -> [Race-id(305101), ]
|
||||||
|
125 -> [Race-id(305201), ]
|
||||||
|
126 -> [Race-id(305301), ]
|
||||||
|
127 -> [Race-id(305401), ]
|
||||||
|
128 -> [Race-id(305501), ]
|
||||||
|
129 -> [Race-id(305601), ]
|
||||||
|
130 -> [Race-id(305701), ]
|
||||||
|
131 -> [Race-id(305801), ]
|
||||||
|
132 -> [Race-id(305901), ]
|
||||||
|
133 -> [Race-id(306001), ]
|
||||||
|
134 -> [Race-id(306101), ]
|
||||||
|
135 -> [Race-id(306201), ]
|
||||||
|
136 -> [Race-id(306301), ]
|
||||||
|
137 -> [Race-id(306401), ]
|
||||||
|
138 -> [Race-id(306501), ]
|
||||||
|
139 -> [Race-id(306601), ]
|
||||||
|
140 -> [Race-id(306701), ]
|
||||||
|
141 -> [Race-id(306801), ]
|
||||||
|
142 -> [Race-id(306901), ]
|
||||||
|
143 -> [Race-id(307001), ]
|
||||||
|
144 -> [Race-id(100501), Race-id(101001), Race-id(102601), ]
|
||||||
|
145 -> [Race-id(100301), Race-id(100601), Race-id(102501), ]
|
||||||
|
146 -> [Race-id(102501), Race-id(102301), ]
|
||||||
|
147 -> [Race-id(102501), ]
|
||||||
|
148 -> [Race-id(102601), ]
|
||||||
|
149 -> [Race-id(203501), ]
|
||||||
|
150 -> [Race-id(405001), ]
|
||||||
|
151 -> [Race-id(100301), Race-id(102701), Race-id(101201), ]
|
||||||
|
152 -> [Race-id(102701), Race-id(101601), ]
|
||||||
|
153 -> [Race-id(102701), ]
|
||||||
|
_ -> []
|
||||||
|
|
||||||
|
// Get a saddle's type.
|
||||||
|
// If no saddle matches the ID, the result is Honor.
|
||||||
|
pub fun saddle-type(s: saddle-id): saddle-type
|
||||||
|
match s.game-id
|
||||||
|
1 -> Honor
|
||||||
|
2 -> Honor
|
||||||
|
3 -> Honor
|
||||||
|
4 -> Honor
|
||||||
|
5 -> Honor
|
||||||
|
6 -> Honor
|
||||||
|
7 -> Honor
|
||||||
|
8 -> Honor
|
||||||
|
9 -> Honor
|
||||||
|
10 -> G1-Win
|
||||||
|
11 -> G1-Win
|
||||||
|
12 -> G1-Win
|
||||||
|
13 -> G1-Win
|
||||||
|
14 -> G1-Win
|
||||||
|
15 -> G1-Win
|
||||||
|
16 -> G1-Win
|
||||||
|
17 -> G1-Win
|
||||||
|
18 -> G1-Win
|
||||||
|
19 -> G1-Win
|
||||||
|
20 -> G1-Win
|
||||||
|
21 -> G1-Win
|
||||||
|
22 -> G1-Win
|
||||||
|
23 -> G1-Win
|
||||||
|
24 -> G1-Win
|
||||||
|
25 -> G1-Win
|
||||||
|
26 -> G1-Win
|
||||||
|
27 -> G1-Win
|
||||||
|
28 -> G1-Win
|
||||||
|
29 -> G1-Win
|
||||||
|
30 -> G1-Win
|
||||||
|
31 -> G1-Win
|
||||||
|
32 -> G1-Win
|
||||||
|
33 -> G1-Win
|
||||||
|
34 -> G1-Win
|
||||||
|
35 -> G1-Win
|
||||||
|
36 -> G1-Win
|
||||||
|
37 -> G1-Win
|
||||||
|
38 -> G1-Win
|
||||||
|
39 -> G1-Win
|
||||||
|
40 -> G2-Win
|
||||||
|
41 -> G2-Win
|
||||||
|
42 -> G2-Win
|
||||||
|
43 -> G2-Win
|
||||||
|
44 -> G2-Win
|
||||||
|
45 -> G2-Win
|
||||||
|
46 -> G2-Win
|
||||||
|
47 -> G2-Win
|
||||||
|
48 -> G2-Win
|
||||||
|
49 -> G2-Win
|
||||||
|
50 -> G2-Win
|
||||||
|
51 -> G2-Win
|
||||||
|
52 -> G2-Win
|
||||||
|
53 -> G2-Win
|
||||||
|
54 -> G2-Win
|
||||||
|
55 -> G2-Win
|
||||||
|
56 -> G2-Win
|
||||||
|
57 -> G2-Win
|
||||||
|
58 -> G2-Win
|
||||||
|
59 -> G2-Win
|
||||||
|
60 -> G2-Win
|
||||||
|
61 -> G2-Win
|
||||||
|
62 -> G2-Win
|
||||||
|
63 -> G2-Win
|
||||||
|
64 -> G2-Win
|
||||||
|
65 -> G2-Win
|
||||||
|
66 -> G2-Win
|
||||||
|
67 -> G2-Win
|
||||||
|
68 -> G2-Win
|
||||||
|
69 -> G2-Win
|
||||||
|
70 -> G2-Win
|
||||||
|
71 -> G2-Win
|
||||||
|
72 -> G2-Win
|
||||||
|
73 -> G2-Win
|
||||||
|
74 -> G3-Win
|
||||||
|
75 -> G3-Win
|
||||||
|
76 -> G3-Win
|
||||||
|
77 -> G3-Win
|
||||||
|
78 -> G3-Win
|
||||||
|
79 -> G3-Win
|
||||||
|
80 -> G3-Win
|
||||||
|
81 -> G3-Win
|
||||||
|
82 -> G3-Win
|
||||||
|
83 -> G3-Win
|
||||||
|
84 -> G3-Win
|
||||||
|
85 -> G3-Win
|
||||||
|
86 -> G3-Win
|
||||||
|
87 -> G3-Win
|
||||||
|
88 -> G3-Win
|
||||||
|
89 -> G3-Win
|
||||||
|
90 -> G3-Win
|
||||||
|
91 -> G2-Win
|
||||||
|
92 -> G3-Win
|
||||||
|
93 -> G3-Win
|
||||||
|
94 -> G3-Win
|
||||||
|
95 -> G3-Win
|
||||||
|
96 -> G3-Win
|
||||||
|
97 -> G3-Win
|
||||||
|
98 -> G3-Win
|
||||||
|
99 -> G3-Win
|
||||||
|
100 -> G3-Win
|
||||||
|
101 -> G3-Win
|
||||||
|
102 -> G3-Win
|
||||||
|
103 -> G3-Win
|
||||||
|
104 -> G3-Win
|
||||||
|
105 -> G3-Win
|
||||||
|
106 -> G3-Win
|
||||||
|
107 -> G3-Win
|
||||||
|
108 -> G3-Win
|
||||||
|
109 -> G3-Win
|
||||||
|
110 -> G3-Win
|
||||||
|
111 -> G3-Win
|
||||||
|
112 -> G3-Win
|
||||||
|
113 -> G3-Win
|
||||||
|
114 -> G3-Win
|
||||||
|
115 -> G3-Win
|
||||||
|
116 -> G3-Win
|
||||||
|
117 -> G3-Win
|
||||||
|
118 -> G3-Win
|
||||||
|
119 -> G3-Win
|
||||||
|
120 -> G3-Win
|
||||||
|
121 -> G3-Win
|
||||||
|
122 -> G3-Win
|
||||||
|
123 -> G3-Win
|
||||||
|
124 -> G3-Win
|
||||||
|
125 -> G3-Win
|
||||||
|
126 -> G3-Win
|
||||||
|
127 -> G3-Win
|
||||||
|
128 -> G3-Win
|
||||||
|
129 -> G3-Win
|
||||||
|
130 -> G3-Win
|
||||||
|
131 -> G2-Win
|
||||||
|
132 -> G3-Win
|
||||||
|
133 -> G3-Win
|
||||||
|
134 -> G3-Win
|
||||||
|
135 -> G3-Win
|
||||||
|
136 -> G3-Win
|
||||||
|
137 -> G3-Win
|
||||||
|
138 -> G3-Win
|
||||||
|
139 -> G3-Win
|
||||||
|
140 -> G3-Win
|
||||||
|
141 -> G3-Win
|
||||||
|
142 -> G3-Win
|
||||||
|
143 -> G3-Win
|
||||||
|
144 -> Honor
|
||||||
|
145 -> Honor
|
||||||
|
146 -> Honor
|
||||||
|
147 -> G1-Win
|
||||||
|
148 -> G1-Win
|
||||||
|
149 -> G2-Win
|
||||||
|
150 -> G3-Win
|
||||||
|
151 -> Honor
|
||||||
|
152 -> Honor
|
||||||
|
153 -> G1-Win
|
||||||
|
_ -> Honor
|
||||||
|
|
||||||
|
// Get the primary ID for a saddle.
|
||||||
|
// For saddles which are the primary version, or if no saddle matches the given ID,
|
||||||
|
// the result is the input.
|
||||||
|
pub fun primary(s: saddle-id): saddle-id
|
||||||
|
match s.game-id
|
||||||
|
144 -> Saddle-id(1)
|
||||||
|
145 -> Saddle-id(4)
|
||||||
|
146 -> Saddle-id(6)
|
||||||
|
147 -> Saddle-id(14)
|
||||||
|
148 -> Saddle-id(16)
|
||||||
|
149 -> Saddle-id(49)
|
||||||
|
151 -> Saddle-id(4)
|
||||||
|
152 -> Saddle-id(5)
|
||||||
|
153 -> Saddle-id(13)
|
||||||
|
_ -> s
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
module horse/legacy
|
module horse/legacy
|
||||||
|
|
||||||
import horse/character
|
import horse/character
|
||||||
|
import horse/game-id
|
||||||
import horse/race
|
import horse/race
|
||||||
import horse/spark
|
import horse/spark
|
||||||
|
|
||||||
@@ -9,9 +10,9 @@ pub struct legacy
|
|||||||
parents: (veteran, veteran)
|
parents: (veteran, veteran)
|
||||||
|
|
||||||
pub struct veteran
|
pub struct veteran
|
||||||
character: character
|
character: character-id
|
||||||
stat: spark<stat>
|
stat: spark<stat>
|
||||||
aptitude: spark<aptitude>
|
aptitude: spark<aptitude>
|
||||||
unique: maybe<spark<unique>>
|
unique: maybe<spark<unique>>
|
||||||
generic: list<spark<generic>>
|
generic: list<spark<generic>>
|
||||||
results: list<race-result>
|
saddles: list<saddle-id>
|
||||||
|
|||||||
@@ -3,9 +3,6 @@ package horse
|
|||||||
type RaceID int32
|
type RaceID int32
|
||||||
|
|
||||||
// Race is the internal data about a race.
|
// Race is the internal data about a race.
|
||||||
//
|
|
||||||
// Races may be offered multiple times in a career in different years.
|
|
||||||
// Each separate offering is a different race instance of the same race.
|
|
||||||
type Race struct {
|
type Race struct {
|
||||||
ID RaceID
|
ID RaceID
|
||||||
Name string
|
Name string
|
||||||
@@ -15,3 +12,26 @@ type Race struct {
|
|||||||
// For such races, this field holds the normal race ID.
|
// For such races, this field holds the normal race ID.
|
||||||
Primary RaceID
|
Primary RaceID
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type SaddleID int32
|
||||||
|
|
||||||
|
// Saddle is the internal data about a race win saddle.
|
||||||
|
type Saddle struct {
|
||||||
|
ID SaddleID
|
||||||
|
Name string
|
||||||
|
Races []RaceID
|
||||||
|
Type SaddleType
|
||||||
|
// Saddles that involve alternate races are themselves alternate.
|
||||||
|
// For such saddles, this field holds the normal saddle ID.
|
||||||
|
Primary SaddleID
|
||||||
|
}
|
||||||
|
|
||||||
|
type SaddleType int8
|
||||||
|
|
||||||
|
const (
|
||||||
|
// Saddle for multiple race wins, e.g. Classic Triple Crown, Dual Grand Prix, &c.
|
||||||
|
SaddleTypeHonor SaddleType = iota
|
||||||
|
SaddleTypeG3
|
||||||
|
SaddleTypeG2
|
||||||
|
SaddleTypeG1
|
||||||
|
)
|
||||||
|
|||||||
@@ -67,11 +67,53 @@ pub fun grade/show(this : grade) : e string
|
|||||||
G1 -> "G1"
|
G1 -> "G1"
|
||||||
EX -> "EX"
|
EX -> "EX"
|
||||||
|
|
||||||
// Instance of a race.
|
pub struct saddle-detail
|
||||||
pub struct race-instance-detail
|
saddle-id: saddle-id
|
||||||
race-instance-id: race-instance-id
|
name: string
|
||||||
race-id: race-id
|
races: list<race-id>
|
||||||
turn: turn
|
saddle-type: saddle-type
|
||||||
|
// For careers with unusual races, granted saddles also differ.
|
||||||
|
// This field holds the normal saddle's ID for such cases.
|
||||||
|
primary: saddle-id
|
||||||
|
|
||||||
|
pub fun saddle/detail(
|
||||||
|
id: saddle-id,
|
||||||
|
?saddle/show: (saddle-id) -> string,
|
||||||
|
?saddle/races: (saddle-id) -> list<race-id>,
|
||||||
|
?saddle/saddle-type: (saddle-id) -> saddle-type,
|
||||||
|
?saddle/primary: (saddle-id) -> saddle-id
|
||||||
|
): saddle-detail
|
||||||
|
Saddle-detail(id, id.show, id.races, id.saddle-type, id.primary)
|
||||||
|
|
||||||
|
pub fun saddle-detail/show(s: saddle-detail): string
|
||||||
|
val Saddle-detail(Saddle-id(id), name, _, _, Saddle-id(primary)) = s
|
||||||
|
if id == primary then name else name ++ " (Alternate " ++ id.show ++ ")"
|
||||||
|
|
||||||
|
// Types of saddles.
|
||||||
|
pub type saddle-type
|
||||||
|
Honor // multiple race wins: classic triple crown, dual grand prix, &c.
|
||||||
|
G3-Win
|
||||||
|
G2-Win
|
||||||
|
G1-Win
|
||||||
|
|
||||||
|
// Automatically generated.
|
||||||
|
// Shows a string representation of the `saddle-type` type.
|
||||||
|
pub fun saddle-type/show(this : saddle-type) : e string
|
||||||
|
match this
|
||||||
|
Honor -> "Honor"
|
||||||
|
G3-Win -> "G3"
|
||||||
|
G2-Win -> "G2"
|
||||||
|
G1-Win -> "G1"
|
||||||
|
|
||||||
|
// Automatically generated.
|
||||||
|
// Equality comparison of the `saddle-type` type.
|
||||||
|
pub fun saddle-type/(==)(this : saddle-type, other : saddle-type) : e bool
|
||||||
|
match (this, other)
|
||||||
|
(Honor, Honor) -> True
|
||||||
|
(G3-Win, G3-Win) -> True
|
||||||
|
(G2-Win, G2-Win) -> True
|
||||||
|
(G1-Win, G1-Win) -> True
|
||||||
|
(_, _) -> False
|
||||||
|
|
||||||
// Turn that a race occurred.
|
// Turn that a race occurred.
|
||||||
pub struct turn
|
pub struct turn
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ module horse/trainee
|
|||||||
|
|
||||||
import horse/game-id
|
import horse/game-id
|
||||||
import horse/movement
|
import horse/movement
|
||||||
|
import horse/race
|
||||||
|
|
||||||
// Details of a trainee.
|
// Details of a trainee.
|
||||||
pub struct trainee-detail
|
pub struct trainee-detail
|
||||||
@@ -15,24 +16,3 @@ pub struct trainee-detail
|
|||||||
pace-chaser: level
|
pace-chaser: level
|
||||||
late-surger: level
|
late-surger: level
|
||||||
end-closer: level
|
end-closer: level
|
||||||
|
|
||||||
// Graded race that a veteran ran.
|
|
||||||
pub struct race-result
|
|
||||||
race-id: race-id
|
|
||||||
race-instance-id: race-instance-id
|
|
||||||
place: int
|
|
||||||
|
|
||||||
// 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-id, race-instance-id, place), Race-result(race-id', race-instance-id', place')) -> race-id == race-id' && race-instance-id == race-instance-id' && place == place'
|
|
||||||
|
|
||||||
pub fun race-result/show(r: race-result, ?race/show: (race-id) -> string) : e string
|
|
||||||
val Race-result(race, _, place) = r
|
|
||||||
race.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
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import (
|
|||||||
"unicode"
|
"unicode"
|
||||||
)
|
)
|
||||||
|
|
||||||
//go:embed character.kk.template skill.kk.template character.go.template skill.go.template race.kk.template race.go.template
|
//go:embed *.template
|
||||||
var templates embed.FS
|
var templates embed.FS
|
||||||
|
|
||||||
// LoadTemplates sets up templates to render game data to source code.
|
// LoadTemplates sets up templates to render game data to source code.
|
||||||
@@ -108,6 +108,21 @@ func ExecRace(t *template.Template, region string, kk, g io.Writer, races []Race
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func ExecSaddle(t *template.Template, region string, kk, g io.Writer, saddles []Saddle) error {
|
||||||
|
data := struct {
|
||||||
|
Region string
|
||||||
|
Saddles []Saddle
|
||||||
|
}{region, saddles}
|
||||||
|
var err error
|
||||||
|
if kk != nil {
|
||||||
|
err = errors.Join(err, t.ExecuteTemplate(kk, "koka-saddle", &data))
|
||||||
|
}
|
||||||
|
if g != nil {
|
||||||
|
err = errors.Join(err, t.ExecuteTemplate(g, "go-saddle", &data))
|
||||||
|
}
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
const wordSeps = " ,!?/-+();#○☆♡'=♪∀゚∴"
|
const wordSeps = " ,!?/-+();#○☆♡'=♪∀゚∴"
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
|||||||
@@ -26,6 +26,9 @@ var skillSQL string
|
|||||||
//go:embed race.sql
|
//go:embed race.sql
|
||||||
var raceSQL string
|
var raceSQL string
|
||||||
|
|
||||||
|
//go:embed saddle.sql
|
||||||
|
var saddleSQL string
|
||||||
|
|
||||||
type (
|
type (
|
||||||
Character struct{}
|
Character struct{}
|
||||||
SkillGroup struct{}
|
SkillGroup struct{}
|
||||||
@@ -359,3 +362,46 @@ func Races(ctx context.Context, db *sqlitex.Pool) ([]Race, error) {
|
|||||||
}
|
}
|
||||||
return r, nil
|
return r, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type Saddle struct {
|
||||||
|
ID int
|
||||||
|
Name string
|
||||||
|
Races [3]int
|
||||||
|
Type int
|
||||||
|
Primary int
|
||||||
|
Alternate int
|
||||||
|
}
|
||||||
|
|
||||||
|
func Saddles(ctx context.Context, db *sqlitex.Pool) ([]Saddle, error) {
|
||||||
|
conn, err := db.Take(ctx)
|
||||||
|
defer db.Put(conn)
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("couldn't get connection for saddles: %w", err)
|
||||||
|
}
|
||||||
|
stmt, _, err := conn.PrepareTransient(saddleSQL)
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("couldn't prepare statement for saddles: %w", err)
|
||||||
|
}
|
||||||
|
defer stmt.Finalize()
|
||||||
|
|
||||||
|
var r []Saddle
|
||||||
|
for {
|
||||||
|
ok, err := stmt.Step()
|
||||||
|
if err != nil {
|
||||||
|
return nil, fmt.Errorf("error stepping saddles: %w", err)
|
||||||
|
}
|
||||||
|
if !ok {
|
||||||
|
break
|
||||||
|
}
|
||||||
|
s := Saddle{
|
||||||
|
ID: stmt.ColumnInt(0),
|
||||||
|
Name: stmt.ColumnText(1),
|
||||||
|
Races: [3]int{stmt.ColumnInt(2), stmt.ColumnInt(3), stmt.ColumnInt(4)},
|
||||||
|
Type: stmt.ColumnInt(5),
|
||||||
|
Primary: stmt.ColumnInt(6),
|
||||||
|
Alternate: stmt.ColumnInt(7),
|
||||||
|
}
|
||||||
|
r = append(r, s)
|
||||||
|
}
|
||||||
|
return r, nil
|
||||||
|
}
|
||||||
|
|||||||
@@ -51,6 +51,7 @@ func main() {
|
|||||||
sg []NamedID[SkillGroup]
|
sg []NamedID[SkillGroup]
|
||||||
skills []Skill
|
skills []Skill
|
||||||
races []Race
|
races []Race
|
||||||
|
saddles []Saddle
|
||||||
)
|
)
|
||||||
eg.Go(func() error {
|
eg.Go(func() error {
|
||||||
slog.Info("get characters")
|
slog.Info("get characters")
|
||||||
@@ -88,6 +89,12 @@ func main() {
|
|||||||
races = r
|
races = r
|
||||||
return err
|
return err
|
||||||
})
|
})
|
||||||
|
eg.Go(func() error {
|
||||||
|
slog.Info("get saddles")
|
||||||
|
s, err := Saddles(ctx, db)
|
||||||
|
saddles = s
|
||||||
|
return err
|
||||||
|
})
|
||||||
if err := eg.Wait(); err != nil {
|
if err := eg.Wait(); err != nil {
|
||||||
slog.Error("load", slog.Any("err", err))
|
slog.Error("load", slog.Any("err", err))
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
@@ -135,6 +142,18 @@ func main() {
|
|||||||
slog.Info("write races")
|
slog.Info("write races")
|
||||||
return ExecRace(t, region, kf, gf, races)
|
return ExecRace(t, region, kf, gf, races)
|
||||||
})
|
})
|
||||||
|
eg.Go(func() error {
|
||||||
|
kf, err := os.Create(filepath.Join(out, region, "saddle.kk"))
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
gf, err := os.Create(filepath.Join(out, region, "saddle.go"))
|
||||||
|
if err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
slog.Info("write saddles")
|
||||||
|
return ExecSaddle(t, region, kf, gf, saddles)
|
||||||
|
})
|
||||||
if err := eg.Wait(); err != nil {
|
if err := eg.Wait(); err != nil {
|
||||||
slog.Error("generate", slog.Any("err", err))
|
slog.Error("generate", slog.Any("err", err))
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
|
|||||||
27
horsegen/saddle.go.template
Normal file
27
horsegen/saddle.go.template
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
{{- define "go-saddle" -}}
|
||||||
|
package {{ $.Region }}
|
||||||
|
|
||||||
|
// Automatically generated with horsegen; DO NOT EDIT
|
||||||
|
|
||||||
|
import . "git.sunturtle.xyz/zephyr/horse/horse"
|
||||||
|
|
||||||
|
const (
|
||||||
|
{{- range $s := $.Saddles }}
|
||||||
|
Saddle{{ goenum $s.Name }}{{ if $s.Alternate }}Alt{{ $s.Alternate }}{{ end }} SaddleID = {{ $s.ID }} // {{ $s.Name }}
|
||||||
|
{{- end }}
|
||||||
|
)
|
||||||
|
|
||||||
|
var AllSaddles = map[SaddleID]Saddle{
|
||||||
|
{{- range $s := $.Saddles }}
|
||||||
|
Saddle{{ goenum $s.Name }}{{ if $s.Alternate }}Alt{{ $s.Alternate }}{{ end }}: {
|
||||||
|
ID: {{ $s.ID }},
|
||||||
|
Name: {{ printf "%q" $s.Name }}{{ if $s.Alternate }} + " (Alternate {{ $s.Alternate }})"{{ end }},
|
||||||
|
Races: []RaceID{ {{- range $id := $s.Races }}{{ if $id }}{{ $id }}, {{ end }}{{ end -}} },
|
||||||
|
Type: SaddleType{{ if eq $s.Type 0 }}Honor{{ else if eq $s.Type 1 }}G3{{ else if eq $s.Type 2 }}G2{{ else if eq $s.Type 3 }}G1{{ else }}??? $s.Type={{ $s.Type }}{{ end }},
|
||||||
|
{{- if $s.Alternate }}
|
||||||
|
Primary: {{ $s.Primary }},
|
||||||
|
{{- end }}
|
||||||
|
},
|
||||||
|
{{- end }}
|
||||||
|
}
|
||||||
|
{{ end }}
|
||||||
69
horsegen/saddle.kk.template
Normal file
69
horsegen/saddle.kk.template
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
{{- define "koka-saddle" -}}
|
||||||
|
module horse/{{ $.Region }}/saddle
|
||||||
|
|
||||||
|
// Automatically generated with horsegen; DO NOT EDIT
|
||||||
|
|
||||||
|
import horse/game-id
|
||||||
|
pub import horse/race
|
||||||
|
pub import horse/{{ $.Region }}/race
|
||||||
|
|
||||||
|
// Enumeration of all saddles for type-safe programming.
|
||||||
|
pub type saddle
|
||||||
|
{{- range $s := $.Saddles }}
|
||||||
|
{{ kkenum $s.Name }}{{ if $s.Alternate }}-Alt{{ $s.Alternate }}{{ end }}
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
// Get the saddle ID for a saddle.
|
||||||
|
pub fun saddle-id(s: saddle): saddle-id
|
||||||
|
match s
|
||||||
|
{{- range $s := $.Saddles }}
|
||||||
|
{{ kkenum $s.Name }}{{ if $s.Alternate }}-Alt{{ $s.Alternate }}{{ end }} -> Saddle-id({{ $s.ID }})
|
||||||
|
{{- end }}
|
||||||
|
|
||||||
|
// List of all saddles in ID order for easy iterating.
|
||||||
|
pub val all = [
|
||||||
|
{{- range $s := $.Saddles }}
|
||||||
|
{{ kkenum $s.Name }}{{ if $s.Alternate }}-Alt{{ $s.Alternate }}{{ end }},
|
||||||
|
{{- end }}
|
||||||
|
]
|
||||||
|
|
||||||
|
// Get the name for a saddle.
|
||||||
|
// Alternate versions of saddles have an indication of such in their names.
|
||||||
|
// If no saddle matches the ID, the result contains the numeric ID.
|
||||||
|
pub fun show(s: saddle-id): string
|
||||||
|
match s.game-id
|
||||||
|
{{- range $s := $.Saddles }}
|
||||||
|
{{ $s.ID }} -> {{ printf "%q" $s.Name }}{{ if $s.Alternate }} ++ " (Alternate {{ $s.Alternate }})"{{ end }}
|
||||||
|
{{- end }}
|
||||||
|
x -> "saddle " ++ x.show
|
||||||
|
|
||||||
|
// Get the list of races that entitle a horse to a saddle.
|
||||||
|
// If no saddle matches the ID, the result is the empty list.
|
||||||
|
pub fun races(s: saddle-id): list<race-id>
|
||||||
|
match s.game-id
|
||||||
|
{{- range $s := $.Saddles }}
|
||||||
|
{{ $s.ID }} -> [{{ range $id := $s.Races }}{{ if $id }}Race-id({{ $id }}), {{ end }}{{ end }}]
|
||||||
|
{{- end }}
|
||||||
|
_ -> []
|
||||||
|
|
||||||
|
// Get a saddle's type.
|
||||||
|
// If no saddle matches the ID, the result is Honor.
|
||||||
|
pub fun saddle-type(s: saddle-id): saddle-type
|
||||||
|
match s.game-id
|
||||||
|
{{- range $s := $.Saddles }}
|
||||||
|
{{ $s.ID }} -> {{ if eq $s.Type 0 }}Honor{{ else if eq $s.Type 1 }}G3-Win{{ else if eq $s.Type 2 }}G2-Win{{ else if eq $s.Type 3 }}G1-Win{{ else }}??? $s.Type={{ $s.Type }}{{ end }}
|
||||||
|
{{- end }}
|
||||||
|
_ -> Honor
|
||||||
|
|
||||||
|
// Get the primary ID for a saddle.
|
||||||
|
// For saddles which are the primary version, or if no saddle matches the given ID,
|
||||||
|
// the result is the input.
|
||||||
|
pub fun primary(s: saddle-id): saddle-id
|
||||||
|
match s.game-id
|
||||||
|
{{- range $s := $.Saddles }}
|
||||||
|
{{- if $s.Alternate }}
|
||||||
|
{{ $s.ID }} -> Saddle-id({{ $s.Primary }})
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
_ -> s
|
||||||
|
{{ end }}
|
||||||
20
horsegen/saddle.sql
Normal file
20
horsegen/saddle.sql
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
WITH saddle_names AS (
|
||||||
|
SELECT "index" AS id, "text" AS name
|
||||||
|
FROM text_data
|
||||||
|
WHERE category = 111
|
||||||
|
)
|
||||||
|
SELECT
|
||||||
|
s.id,
|
||||||
|
n.name,
|
||||||
|
ri1.id AS race1,
|
||||||
|
IFNULL(ri2.id, 0) AS race2,
|
||||||
|
IFNULL(ri3.id, 0) AS race3,
|
||||||
|
s.win_saddle_type,
|
||||||
|
MIN(s.id) OVER (PARTITION BY n.name) AS "primary",
|
||||||
|
ROW_NUMBER() OVER (PARTITION BY n.name ORDER BY s.id) - 1 AS "alternate"
|
||||||
|
FROM single_mode_wins_saddle s
|
||||||
|
JOIN race_instance ri1 ON s.race_instance_id_1 = ri1.id
|
||||||
|
LEFT JOIN race_instance ri2 ON s.race_instance_id_2 = ri2.id
|
||||||
|
LEFT JOIN race_instance ri3 ON s.race_instance_id_3 = ri3.id
|
||||||
|
LEFT JOIN saddle_names n ON s.id = n.id
|
||||||
|
ORDER BY s.id
|
||||||
Reference in New Issue
Block a user