From 2fcd60810215442b999b2443df37fa9861dcc204 Mon Sep 17 00:00:00 2001 From: Branden J Brown Date: Sat, 7 Feb 2026 09:34:19 -0500 Subject: [PATCH] horse: rework for saddles --- doc/README.md | 2 +- horse/game-id.kk | 10 +++++----- horse/legacy.kk | 5 +++-- horse/race.kk | 6 ------ horse/trainee.kk | 22 +--------------------- 5 files changed, 10 insertions(+), 35 deletions(-) diff --git a/doc/README.md b/doc/README.md index 7fa7bc2..8e882d2 100644 --- a/doc/README.md +++ b/doc/README.md @@ -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) diff --git a/horse/game-id.kk b/horse/game-id.kk index 168f6a3..5cdd902 100644 --- a/horse/game-id.kk +++ b/horse/game-id.kk @@ -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 match x.game-id.cmp(y.game-id) diff --git a/horse/legacy.kk b/horse/legacy.kk index 2c0d7d2..ee3ac3b 100644 --- a/horse/legacy.kk +++ b/horse/legacy.kk @@ -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 aptitude: spark unique: maybe> generic: list> - results: list + saddles: list diff --git a/horse/race.kk b/horse/race.kk index 9742b5d..e2d3be9 100644 --- a/horse/race.kk +++ b/horse/race.kk @@ -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 diff --git a/horse/trainee.kk b/horse/trainee.kk index 8a77fe2..4691c06 100644 --- a/horse/trainee.kk +++ b/horse/trainee.kk @@ -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