horse: rework for saddles
This commit is contained in:
@@ -10,7 +10,7 @@ This file is my notes from exploring the database.
|
||||
- 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
|
||||
- 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?
|
||||
|
||||
# succession factor (sparks)
|
||||
|
||||
@@ -34,15 +34,15 @@ pub struct skill-icon-id
|
||||
pub struct race-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.
|
||||
pub struct race-thumbnail-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.
|
||||
pub inline fun order2(x: a, y: a, ?a/game-id: (a) -> game-id): order2<a>
|
||||
match x.game-id.cmp(y.game-id)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
module horse/legacy
|
||||
|
||||
import horse/character
|
||||
import horse/game-id
|
||||
import horse/race
|
||||
import horse/spark
|
||||
|
||||
@@ -9,9 +10,9 @@ pub struct legacy
|
||||
parents: (veteran, veteran)
|
||||
|
||||
pub struct veteran
|
||||
character: character
|
||||
character: character-id
|
||||
stat: spark<stat>
|
||||
aptitude: spark<aptitude>
|
||||
unique: maybe<spark<unique>>
|
||||
generic: list<spark<generic>>
|
||||
results: list<race-result>
|
||||
saddles: list<saddle-id>
|
||||
|
||||
@@ -67,12 +67,6 @@ pub fun grade/show(this : grade) : e string
|
||||
G1 -> "G1"
|
||||
EX -> "EX"
|
||||
|
||||
// Instance of a race.
|
||||
pub struct race-instance-detail
|
||||
race-instance-id: race-instance-id
|
||||
race-id: race-id
|
||||
turn: turn
|
||||
|
||||
// Turn that a race occurred.
|
||||
pub struct turn
|
||||
year: turn-year
|
||||
|
||||
@@ -2,6 +2,7 @@ module horse/trainee
|
||||
|
||||
import horse/game-id
|
||||
import horse/movement
|
||||
import horse/race
|
||||
|
||||
// Details of a trainee.
|
||||
pub struct trainee-detail
|
||||
@@ -15,24 +16,3 @@ pub struct trainee-detail
|
||||
pace-chaser: level
|
||||
late-surger: 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
|
||||
|
||||
Reference in New Issue
Block a user