umadump/replay: decode race replays
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -0,0 +1,29 @@
|
||||
// Code generated by "stringer -type CardRarity -linecomment -trimprefix Card"; DO NOT EDIT.
|
||||
|
||||
package replay
|
||||
|
||||
import "strconv"
|
||||
|
||||
func _() {
|
||||
// An "invalid array index" compiler error signifies that the constant values have changed.
|
||||
// Re-run the stringer command to generate them again.
|
||||
var x [1]struct{}
|
||||
_ = x[CardNone-0]
|
||||
_ = x[CardRare1-1]
|
||||
_ = x[CardRare2-2]
|
||||
_ = x[CardRare3-3]
|
||||
_ = x[CardRare4-4]
|
||||
_ = x[CardRare5-5]
|
||||
}
|
||||
|
||||
const _CardRarity_name = "NONERare1Rare2Rare3Rare4Rare5"
|
||||
|
||||
var _CardRarity_index = [...]uint8{0, 4, 9, 14, 19, 24, 29}
|
||||
|
||||
func (i CardRarity) String() string {
|
||||
idx := int(i) - 0
|
||||
if i < 0 || idx >= len(_CardRarity_index)-1 {
|
||||
return "CardRarity(" + strconv.FormatInt(int64(i), 10) + ")"
|
||||
}
|
||||
return _CardRarity_name[_CardRarity_index[idx]:_CardRarity_index[idx+1]]
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
// Code generated by "stringer -type CharaGradeType -linecomment -trimprefix CharaGrade"; DO NOT EDIT.
|
||||
|
||||
package replay
|
||||
|
||||
import "strconv"
|
||||
|
||||
func _() {
|
||||
// An "invalid array index" compiler error signifies that the constant values have changed.
|
||||
// Re-run the stringer command to generate them again.
|
||||
var x [1]struct{}
|
||||
_ = x[CharaGradeNone-0]
|
||||
_ = x[CharaGradeDebut-1]
|
||||
_ = x[CharaGradeNoWin-2]
|
||||
_ = x[CharaGradeOpen-3]
|
||||
_ = x[CharaGradeG3Silver-4]
|
||||
_ = x[CharaGradeG3Gold-5]
|
||||
_ = x[CharaGradeG2Silver-6]
|
||||
_ = x[CharaGradeG2Gold-7]
|
||||
_ = x[CharaGradeG1Bronze-8]
|
||||
_ = x[CharaGradeG1Silver-9]
|
||||
_ = x[CharaGradeG1Gold-10]
|
||||
_ = x[charaGradeMax-11]
|
||||
}
|
||||
|
||||
const _CharaGradeType_name = "NONEDebutNoWinOpenG3SilverG3GoldG2SilverG2GoldG1BronzeG1SilverG1GoldcharaGradeMax"
|
||||
|
||||
var _CharaGradeType_index = [...]uint8{0, 4, 9, 14, 18, 26, 32, 40, 46, 54, 62, 68, 81}
|
||||
|
||||
func (i CharaGradeType) String() string {
|
||||
idx := int(i) - 0
|
||||
if i < 0 || idx >= len(_CharaGradeType_index)-1 {
|
||||
return "CharaGradeType(" + strconv.FormatInt(int64(i), 10) + ")"
|
||||
}
|
||||
return _CharaGradeType_name[_CharaGradeType_index[idx]:_CharaGradeType_index[idx+1]]
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
// Code generated by "stringer -type CourseDistanceType -linecomment -trimprefix Distance"; DO NOT EDIT.
|
||||
|
||||
package replay
|
||||
|
||||
import "strconv"
|
||||
|
||||
func _() {
|
||||
// An "invalid array index" compiler error signifies that the constant values have changed.
|
||||
// Re-run the stringer command to generate them again.
|
||||
var x [1]struct{}
|
||||
_ = x[DistanceSprint-1]
|
||||
_ = x[DistanceMile-2]
|
||||
_ = x[DistanceMedium-3]
|
||||
_ = x[DistanceLong-4]
|
||||
}
|
||||
|
||||
const _CourseDistanceType_name = "ShortMileMiddleLong"
|
||||
|
||||
var _CourseDistanceType_index = [...]uint8{0, 5, 9, 15, 19}
|
||||
|
||||
func (i CourseDistanceType) String() string {
|
||||
idx := int(i) - 1
|
||||
if i < 1 || idx >= len(_CourseDistanceType_index)-1 {
|
||||
return "CourseDistanceType(" + strconv.FormatInt(int64(i), 10) + ")"
|
||||
}
|
||||
return _CourseDistanceType_name[_CourseDistanceType_index[idx]:_CourseDistanceType_index[idx+1]]
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
// Code generated by "stringer -type GroundCondition -linecomment"; DO NOT EDIT.
|
||||
|
||||
package replay
|
||||
|
||||
import "strconv"
|
||||
|
||||
func _() {
|
||||
// An "invalid array index" compiler error signifies that the constant values have changed.
|
||||
// Re-run the stringer command to generate them again.
|
||||
var x [1]struct{}
|
||||
_ = x[GroundFirm-1]
|
||||
_ = x[GroundGood-2]
|
||||
_ = x[GroundSoft-3]
|
||||
_ = x[GroundHeavy-4]
|
||||
}
|
||||
|
||||
const _GroundCondition_name = "GoodSoftHardBad"
|
||||
|
||||
var _GroundCondition_index = [...]uint8{0, 4, 8, 12, 15}
|
||||
|
||||
func (i GroundCondition) String() string {
|
||||
idx := int(i) - 1
|
||||
if i < 1 || idx >= len(_GroundCondition_index)-1 {
|
||||
return "GroundCondition(" + strconv.FormatInt(int64(i), 10) + ")"
|
||||
}
|
||||
return _GroundCondition_name[_GroundCondition_index[idx]:_GroundCondition_index[idx+1]]
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
// Code generated by "stringer -type InitialLaneType -trimprefix InitialLane"; DO NOT EDIT.
|
||||
|
||||
package replay
|
||||
|
||||
import "strconv"
|
||||
|
||||
func _() {
|
||||
// An "invalid array index" compiler error signifies that the constant values have changed.
|
||||
// Re-run the stringer command to generate them again.
|
||||
var x [1]struct{}
|
||||
_ = x[InitialLaneExtraSpaceAfter9-1]
|
||||
_ = x[InitialLaneEquidistant-2]
|
||||
_ = x[InitialLaneExtraSpaceAfter14-3]
|
||||
_ = x[InitialLaneExtraSpaceAfter8-4]
|
||||
_ = x[initialLaneMax-5]
|
||||
}
|
||||
|
||||
const _InitialLaneType_name = "ExtraSpaceAfter9EquidistantExtraSpaceAfter14ExtraSpaceAfter8initialLaneMax"
|
||||
|
||||
var _InitialLaneType_index = [...]uint8{0, 16, 27, 44, 60, 74}
|
||||
|
||||
func (i InitialLaneType) String() string {
|
||||
idx := int(i) - 1
|
||||
if i < 1 || idx >= len(_InitialLaneType_index)-1 {
|
||||
return "InitialLaneType(" + strconv.FormatInt(int64(i), 10) + ")"
|
||||
}
|
||||
return _InitialLaneType_name[_InitialLaneType_index[idx]:_InitialLaneType_index[idx+1]]
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
// Code generated by "stringer -type MainStoryRaceGimmickType -linecomment"; DO NOT EDIT.
|
||||
|
||||
package replay
|
||||
|
||||
import "strconv"
|
||||
|
||||
func _() {
|
||||
// An "invalid array index" compiler error signifies that the constant values have changed.
|
||||
// Re-run the stringer command to generate them again.
|
||||
var x [1]struct{}
|
||||
_ = x[GimmickNone-0]
|
||||
_ = x[GimmickSpecial00-1]
|
||||
_ = x[gimmickMax-2]
|
||||
}
|
||||
|
||||
const _MainStoryRaceGimmickType_name = "NONESpecial_00gimmickMax"
|
||||
|
||||
var _MainStoryRaceGimmickType_index = [...]uint8{0, 4, 14, 24}
|
||||
|
||||
func (i MainStoryRaceGimmickType) String() string {
|
||||
idx := int(i) - 0
|
||||
if i < 0 || idx >= len(_MainStoryRaceGimmickType_index)-1 {
|
||||
return "MainStoryRaceGimmickType(" + strconv.FormatInt(int64(i), 10) + ")"
|
||||
}
|
||||
return _MainStoryRaceGimmickType_name[_MainStoryRaceGimmickType_index[idx]:_MainStoryRaceGimmickType_index[idx+1]]
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
// Code generated by "stringer -type Motivation -linecomment"; DO NOT EDIT.
|
||||
|
||||
package replay
|
||||
|
||||
import "strconv"
|
||||
|
||||
func _() {
|
||||
// An "invalid array index" compiler error signifies that the constant values have changed.
|
||||
// Re-run the stringer command to generate them again.
|
||||
var x [1]struct{}
|
||||
_ = x[MotivationNone-0]
|
||||
_ = x[MotivationAwful-1]
|
||||
_ = x[MotivationBad-2]
|
||||
_ = x[MotivationNormal-3]
|
||||
_ = x[MotivationGood-4]
|
||||
_ = x[MotivationGreat-5]
|
||||
}
|
||||
|
||||
const _Motivation_name = "NoneMinLowMiddleHighMax"
|
||||
|
||||
var _Motivation_index = [...]uint8{0, 4, 7, 10, 16, 20, 23}
|
||||
|
||||
func (i Motivation) String() string {
|
||||
idx := int(i) - 0
|
||||
if i < 0 || idx >= len(_Motivation_index)-1 {
|
||||
return "Motivation(" + strconv.FormatInt(int64(i), 10) + ")"
|
||||
}
|
||||
return _Motivation_name[_Motivation_index[idx]:_Motivation_index[idx+1]]
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
// Code generated by "stringer -type ProperGrade -trimprefix Aptitude"; DO NOT EDIT.
|
||||
|
||||
package replay
|
||||
|
||||
import "strconv"
|
||||
|
||||
func _() {
|
||||
// An "invalid array index" compiler error signifies that the constant values have changed.
|
||||
// Re-run the stringer command to generate them again.
|
||||
var x [1]struct{}
|
||||
_ = x[AptitudeNull-0]
|
||||
_ = x[AptitudeG-1]
|
||||
_ = x[AptitudeF-2]
|
||||
_ = x[AptitudeE-3]
|
||||
_ = x[AptitudeD-4]
|
||||
_ = x[AptitudeC-5]
|
||||
_ = x[AptitudeB-6]
|
||||
_ = x[AptitudeA-7]
|
||||
_ = x[AptitudeS-8]
|
||||
}
|
||||
|
||||
const _ProperGrade_name = "NullGFEDCBAS"
|
||||
|
||||
var _ProperGrade_index = [...]uint8{0, 4, 5, 6, 7, 8, 9, 10, 11, 12}
|
||||
|
||||
func (i ProperGrade) String() string {
|
||||
idx := int(i) - 0
|
||||
if i < 0 || idx >= len(_ProperGrade_index)-1 {
|
||||
return "ProperGrade(" + strconv.FormatInt(int64(i), 10) + ")"
|
||||
}
|
||||
return _ProperGrade_name[_ProperGrade_index[idx]:_ProperGrade_index[idx+1]]
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
// Code generated by "stringer -type RaceDifficulty -trimprefix Difficulty"; DO NOT EDIT.
|
||||
|
||||
package replay
|
||||
|
||||
import "strconv"
|
||||
|
||||
func _() {
|
||||
// An "invalid array index" compiler error signifies that the constant values have changed.
|
||||
// Re-run the stringer command to generate them again.
|
||||
var x [1]struct{}
|
||||
_ = x[DifficultyEasy-1]
|
||||
_ = x[DifficultyNormal-2]
|
||||
_ = x[DifficultyHard-3]
|
||||
_ = x[DifficultyVeryHard-4]
|
||||
_ = x[DifficultyExtreme-5]
|
||||
_ = x[difficultyMax-6]
|
||||
}
|
||||
|
||||
const _RaceDifficulty_name = "EasyNormalHardVeryHardExtremedifficultyMax"
|
||||
|
||||
var _RaceDifficulty_index = [...]uint8{0, 4, 10, 14, 22, 29, 42}
|
||||
|
||||
func (i RaceDifficulty) String() string {
|
||||
idx := int(i) - 1
|
||||
if i < 1 || idx >= len(_RaceDifficulty_index)-1 {
|
||||
return "RaceDifficulty(" + strconv.FormatInt(int64(i), 10) + ")"
|
||||
}
|
||||
return _RaceDifficulty_name[_RaceDifficulty_index[idx]:_RaceDifficulty_index[idx+1]]
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
// Code generated by "stringer -type RaceTime -trimprefix Time"; DO NOT EDIT.
|
||||
|
||||
package replay
|
||||
|
||||
import "strconv"
|
||||
|
||||
func _() {
|
||||
// An "invalid array index" compiler error signifies that the constant values have changed.
|
||||
// Re-run the stringer command to generate them again.
|
||||
var x [1]struct{}
|
||||
_ = x[TimeMin-0]
|
||||
_ = x[TimeMorning-1]
|
||||
_ = x[TimeDaytime-2]
|
||||
_ = x[TimeEvening-3]
|
||||
_ = x[TimeNight-4]
|
||||
_ = x[TimeMax-5]
|
||||
}
|
||||
|
||||
const _RaceTime_name = "MinMorningDaytimeEveningNightMax"
|
||||
|
||||
var _RaceTime_index = [...]uint8{0, 3, 10, 17, 24, 29, 32}
|
||||
|
||||
func (i RaceTime) String() string {
|
||||
idx := int(i) - 0
|
||||
if i < 0 || idx >= len(_RaceTime_index)-1 {
|
||||
return "RaceTime(" + strconv.FormatInt(int64(i), 10) + ")"
|
||||
}
|
||||
return _RaceTime_name[_RaceTime_index[idx]:_RaceTime_index[idx+1]]
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
// Code generated by "stringer -type RaceType -linecomment -trimprefix RaceType"; DO NOT EDIT.
|
||||
|
||||
package replay
|
||||
|
||||
import "strconv"
|
||||
|
||||
func _() {
|
||||
// An "invalid array index" compiler error signifies that the constant values have changed.
|
||||
// Re-run the stringer command to generate them again.
|
||||
var x [1]struct{}
|
||||
_ = x[RaceTypeNone-0]
|
||||
_ = x[RaceTypePvP-1]
|
||||
_ = x[RaceTypeTutorial-2]
|
||||
_ = x[RaceTypeStory-3]
|
||||
_ = x[RaceTypeStoryCondition-4]
|
||||
_ = x[RaceTypeChampions-5]
|
||||
_ = x[RaceTypeSingle-6]
|
||||
_ = x[RaceTypeSingleModeScenarioTeamRace-7]
|
||||
_ = x[RaceTypeRoomMatch-8]
|
||||
_ = x[RaceTypePractice-9]
|
||||
_ = x[RaceTypeDaily-10]
|
||||
_ = x[RaceTypeTeamBuilding-11]
|
||||
_ = x[RaceTypeLegend-12]
|
||||
_ = x[RaceTypeChallengeMatch-13]
|
||||
_ = x[RaceTypeTeamStadium-14]
|
||||
_ = x[RaceTypeHeroes-16]
|
||||
_ = x[raceTypeMaxInclusive-16]
|
||||
}
|
||||
|
||||
const (
|
||||
_RaceType_name_0 = "NONEPvPTutorialStoryStoryConditionChampionsSingleSingleModeScenarioTeamRaceRoomMatchPracticeDailyTeamBuildingLegendChallengeMatchTeamStadium"
|
||||
_RaceType_name_1 = "Heroes"
|
||||
)
|
||||
|
||||
var (
|
||||
_RaceType_index_0 = [...]uint8{0, 4, 7, 15, 20, 34, 43, 49, 75, 84, 92, 97, 109, 115, 129, 140}
|
||||
)
|
||||
|
||||
func (i RaceType) String() string {
|
||||
switch {
|
||||
case 0 <= i && i <= 14:
|
||||
return _RaceType_name_0[_RaceType_index_0[i]:_RaceType_index_0[i+1]]
|
||||
case i == 16:
|
||||
return _RaceType_name_1
|
||||
default:
|
||||
return "RaceType(" + strconv.FormatInt(int64(i), 10) + ")"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
// Code generated by "stringer -type RaceWeather -trimprefix Weather"; DO NOT EDIT.
|
||||
|
||||
package replay
|
||||
|
||||
import "strconv"
|
||||
|
||||
func _() {
|
||||
// An "invalid array index" compiler error signifies that the constant values have changed.
|
||||
// Re-run the stringer command to generate them again.
|
||||
var x [1]struct{}
|
||||
_ = x[WeatherMin-0]
|
||||
_ = x[WeatherSunny-1]
|
||||
_ = x[WeatherCloudy-2]
|
||||
_ = x[WeatherRainy-3]
|
||||
_ = x[WeatherSnow-4]
|
||||
_ = x[WeatherMax-5]
|
||||
}
|
||||
|
||||
const _RaceWeather_name = "MinSunnyCloudyRainySnowMax"
|
||||
|
||||
var _RaceWeather_index = [...]uint8{0, 3, 8, 14, 19, 23, 26}
|
||||
|
||||
func (i RaceWeather) String() string {
|
||||
idx := int(i) - 0
|
||||
if i < 0 || idx >= len(_RaceWeather_index)-1 {
|
||||
return "RaceWeather(" + strconv.FormatInt(int64(i), 10) + ")"
|
||||
}
|
||||
return _RaceWeather_name[_RaceWeather_index[idx]:_RaceWeather_index[idx+1]]
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,182 @@
|
||||
package replay_test
|
||||
|
||||
import (
|
||||
_ "embed"
|
||||
"encoding/json"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"git.sunturtle.xyz/zephyr/horse/umadump/replay"
|
||||
)
|
||||
|
||||
//go:embed Mihono_Bourbon-74.2421s-20260829.json
|
||||
var testRace string
|
||||
|
||||
func TestRaceUnmarshal(t *testing.T) {
|
||||
// A replay is simply too large to bother converting by hand for a unit test.
|
||||
// Just test that we can unmarshal and certain important fields are populated.
|
||||
d := json.NewDecoder(strings.NewReader(testRace))
|
||||
d.DisallowUnknownFields()
|
||||
var got replay.Race
|
||||
if err := d.Decode(&got); err != nil {
|
||||
t.Error(err)
|
||||
}
|
||||
if got.RaceType != replay.RaceTypeChampions {
|
||||
t.Errorf("wrong race type: want %v, got %v", replay.RaceTypeChampions, got.RaceType)
|
||||
}
|
||||
if got.RandomSeed != 1667907263 {
|
||||
t.Errorf("wrong random seed: want 1667907263, got %d", got.RandomSeed)
|
||||
}
|
||||
if got.RaceCourseSet.ID != 10903 {
|
||||
t.Errorf("wrong race course: want 10903, got %d", got.RaceCourseSet.ID)
|
||||
}
|
||||
if got.GroundCondition != replay.GroundFirm {
|
||||
t.Errorf("wrong ground condition: want %v, got %v", replay.GroundFirm, got.GroundCondition)
|
||||
}
|
||||
if got.Weather != replay.WeatherCloudy {
|
||||
t.Errorf("wrong weather: want %v, got %v", replay.WeatherCloudy, got.Weather)
|
||||
}
|
||||
if got.NumRaceHorses != 9 {
|
||||
t.Errorf("wrong number of race horses: want 9, got %d", got.NumRaceHorses)
|
||||
}
|
||||
if len(got.PlayerTeamMemberArray) != 3 {
|
||||
t.Errorf("wrong number of team members: want 3, got %d", len(got.PlayerTeamMemberArray))
|
||||
}
|
||||
for _, m := range got.PlayerTeamMemberArray {
|
||||
if m.CharaID == 0 {
|
||||
t.Error("missing team member chara id")
|
||||
}
|
||||
if m.FinishTimeRaw == 0 {
|
||||
t.Error("missing team member finish time raw")
|
||||
}
|
||||
if m.RaceParam.RawSpeed == 0 {
|
||||
t.Error("missing team member race param raw speed")
|
||||
}
|
||||
if m.RaceParam.BaseSpeed == 0 {
|
||||
t.Error("missing team member race param base speed")
|
||||
}
|
||||
if m.ResponseHorseData.ViewerID == 0 {
|
||||
t.Error("missing team member response horse data viewer id")
|
||||
}
|
||||
if m.ResponseHorseData.TrainedCharaID == 0 {
|
||||
t.Error("missing team member response horse data trained chara id")
|
||||
}
|
||||
if m.ResponseHorseData.CardID == 0 {
|
||||
t.Error("missing team member response horse data card id")
|
||||
}
|
||||
if len(m.ResponseHorseData.SkillArray) == 0 {
|
||||
t.Error("missing team member response horse data skill array")
|
||||
}
|
||||
if m.ResponseHorseData.Speed == 0 {
|
||||
t.Error("missing team member response horse data speed")
|
||||
}
|
||||
if m.ResponseHorseData.RunningStyle == 0 {
|
||||
t.Error("missing team member response horse data running style")
|
||||
}
|
||||
if m.ActiveProperDistance == 0 {
|
||||
t.Error("missing team member active distance aptitude")
|
||||
}
|
||||
if m.ActiveProperGroundType == 0 {
|
||||
t.Error("missing team member active surface aptitude")
|
||||
}
|
||||
if m.TrainedCharaData.ID == 0 {
|
||||
t.Error("missing team member trained chara id")
|
||||
}
|
||||
if m.TrainedCharaData.CardID == 0 {
|
||||
t.Error("missing team member trained chara card id")
|
||||
}
|
||||
if m.TrainedCharaData.Speed == 0 {
|
||||
t.Error("missing team member trained chara speed")
|
||||
}
|
||||
if m.TrainedCharaData.RunningStyle == 0 {
|
||||
t.Error("missing team member trained chara running style")
|
||||
}
|
||||
if m.TrainedCharaData.CreateTime == "" {
|
||||
t.Error("missing team member trained chara create time")
|
||||
}
|
||||
if len(m.TrainedCharaData.AcquiredSkillArray) == 0 {
|
||||
t.Error("missing team member trained chara acquired skill array")
|
||||
}
|
||||
}
|
||||
if len(got.RaceHorse) != int(got.NumRaceHorses) {
|
||||
t.Errorf("wrong number of race horses: want %d, got %d", got.NumRaceHorses, len(got.RaceHorse))
|
||||
}
|
||||
zeroFinish, zeroDelta := 0, 0
|
||||
for _, m := range got.RaceHorse {
|
||||
if m.CharaID == 0 {
|
||||
t.Error("missing race horse chara id")
|
||||
}
|
||||
if m.FinishOrder == 0 {
|
||||
zeroFinish++
|
||||
}
|
||||
if m.FinishTimeRaw == 0 {
|
||||
t.Error("missing race horse finish time raw")
|
||||
}
|
||||
if m.FinishDiffTimeFromPrev == 0 {
|
||||
zeroDelta++
|
||||
}
|
||||
if m.RaceParam.RawSpeed == 0 {
|
||||
t.Error("missing race horse race param raw speed")
|
||||
}
|
||||
if m.RaceParam.BaseSpeed == 0 {
|
||||
t.Error("missing race horse race param base speed")
|
||||
}
|
||||
if m.ResponseHorseData.ViewerID == 0 {
|
||||
t.Error("missing race horse response horse data viewer id")
|
||||
}
|
||||
if m.ResponseHorseData.TrainedCharaID == 0 {
|
||||
t.Error("missing race horse response horse data trained chara id")
|
||||
}
|
||||
if m.ResponseHorseData.CardID == 0 {
|
||||
t.Error("missing race horse response horse data card id")
|
||||
}
|
||||
if len(m.ResponseHorseData.SkillArray) == 0 {
|
||||
t.Error("missing race horse response horse data skill array")
|
||||
}
|
||||
if m.ResponseHorseData.Speed == 0 {
|
||||
t.Error("missing race horse response horse data speed")
|
||||
}
|
||||
if m.ResponseHorseData.RunningStyle == 0 {
|
||||
t.Error("missing race horse response horse data running style")
|
||||
}
|
||||
if m.ActiveProperDistance == 0 {
|
||||
t.Error("missing race horse active distance aptitude")
|
||||
}
|
||||
if m.ActiveProperGroundType == 0 {
|
||||
t.Error("missing race horse active surface aptitude")
|
||||
}
|
||||
if m.TrainedCharaData.ID == 0 {
|
||||
t.Error("missing race horse trained chara id")
|
||||
}
|
||||
if m.TrainedCharaData.CardID == 0 {
|
||||
t.Error("missing race horse trained chara card id")
|
||||
}
|
||||
if m.TrainedCharaData.Speed == 0 {
|
||||
t.Error("missing race horse trained chara speed")
|
||||
}
|
||||
if m.TrainedCharaData.RunningStyle == 0 {
|
||||
t.Error("missing race horse trained chara running style")
|
||||
}
|
||||
if m.TrainedCharaData.CreateTime == "" {
|
||||
t.Error("missing race horse trained chara create time")
|
||||
}
|
||||
if len(m.TrainedCharaData.AcquiredSkillArray) == 0 {
|
||||
t.Error("missing race horse trained chara acquired skill array")
|
||||
}
|
||||
}
|
||||
if zeroFinish != 1 {
|
||||
t.Errorf("%d horses in index 0 finish", zeroFinish)
|
||||
}
|
||||
if zeroDelta != 1 {
|
||||
t.Errorf("%d horses with zero finish time delta", zeroDelta)
|
||||
}
|
||||
if got.SimDataBase64 != encodedSimdata {
|
||||
t.Errorf("wrong simdata:\nwant %s\n got %s", encodedSimdata, got.SimDataBase64)
|
||||
}
|
||||
if len(got.HorseIndexByFinishOrder) != len(got.RaceHorse) {
|
||||
t.Errorf("length of horseIndexByFinishOrder (%d) doesn't match length of raceHorse (%d)", len(got.HorseIndexByFinishOrder), len(got.RaceHorse))
|
||||
}
|
||||
if len(got.HorseIndexByPopularity) != len(got.RaceHorse) {
|
||||
t.Errorf("length of horseIndexByPopularity (%d) doesn't match length of raceHorse (%d)", len(got.HorseIndexByPopularity), len(got.RaceHorse))
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
// Code generated by "stringer -type ResultBoardConditionType -linecomment"; DO NOT EDIT.
|
||||
|
||||
package replay
|
||||
|
||||
import "strconv"
|
||||
|
||||
func _() {
|
||||
// An "invalid array index" compiler error signifies that the constant values have changed.
|
||||
// Re-run the stringer command to generate them again.
|
||||
var x [1]struct{}
|
||||
_ = x[ResultBoardTurfNone-1]
|
||||
_ = x[ResultBoardTurfDirt-2]
|
||||
_ = x[ResultBoardDirtNone-3]
|
||||
_ = x[ResultBoardDirtTurf-4]
|
||||
}
|
||||
|
||||
const _ResultBoardConditionType_name = "Turf_NoneTurf_DirtDirt_NoneDirt_Turf"
|
||||
|
||||
var _ResultBoardConditionType_index = [...]uint8{0, 9, 18, 27, 36}
|
||||
|
||||
func (i ResultBoardConditionType) String() string {
|
||||
idx := int(i) - 1
|
||||
if i < 1 || idx >= len(_ResultBoardConditionType_index)-1 {
|
||||
return "ResultBoardConditionType(" + strconv.FormatInt(int64(i), 10) + ")"
|
||||
}
|
||||
return _ResultBoardConditionType_name[_ResultBoardConditionType_index[idx]:_ResultBoardConditionType_index[idx+1]]
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
// Code generated by "stringer -type Rotation -trimprefix Rotation"; DO NOT EDIT.
|
||||
|
||||
package replay
|
||||
|
||||
import "strconv"
|
||||
|
||||
func _() {
|
||||
// An "invalid array index" compiler error signifies that the constant values have changed.
|
||||
// Re-run the stringer command to generate them again.
|
||||
var x [1]struct{}
|
||||
_ = x[RotationRight-1]
|
||||
_ = x[RotationLeft-2]
|
||||
_ = x[RotationStraightRight-3]
|
||||
_ = x[RotationStraightLeft-4]
|
||||
}
|
||||
|
||||
const _Rotation_name = "RightLeftStraightRightStraightLeft"
|
||||
|
||||
var _Rotation_index = [...]uint8{0, 5, 9, 22, 34}
|
||||
|
||||
func (i Rotation) String() string {
|
||||
idx := int(i) - 1
|
||||
if i < 1 || idx >= len(_Rotation_index)-1 {
|
||||
return "Rotation(" + strconv.FormatInt(int64(i), 10) + ")"
|
||||
}
|
||||
return _Rotation_name[_Rotation_index[idx]:_Rotation_index[idx+1]]
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
// Code generated by "stringer -type RunningStyleEx -linecomment"; DO NOT EDIT.
|
||||
|
||||
package replay
|
||||
|
||||
import "strconv"
|
||||
|
||||
func _() {
|
||||
// An "invalid array index" compiler error signifies that the constant values have changed.
|
||||
// Re-run the stringer command to generate them again.
|
||||
var x [1]struct{}
|
||||
_ = x[StyleExNone-0]
|
||||
_ = x[StyleExRunaway-1]
|
||||
}
|
||||
|
||||
const _RunningStyleEx_name = "NONEOonige"
|
||||
|
||||
var _RunningStyleEx_index = [...]uint8{0, 4, 10}
|
||||
|
||||
func (i RunningStyleEx) String() string {
|
||||
idx := int(i) - 0
|
||||
if i < 0 || idx >= len(_RunningStyleEx_index)-1 {
|
||||
return "RunningStyleEx(" + strconv.FormatInt(int64(i), 10) + ")"
|
||||
}
|
||||
return _RunningStyleEx_name[_RunningStyleEx_index[idx]:_RunningStyleEx_index[idx+1]]
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
// Code generated by "stringer -type Season -trimprefix Season"; DO NOT EDIT.
|
||||
|
||||
package replay
|
||||
|
||||
import "strconv"
|
||||
|
||||
func _() {
|
||||
// An "invalid array index" compiler error signifies that the constant values have changed.
|
||||
// Re-run the stringer command to generate them again.
|
||||
var x [1]struct{}
|
||||
_ = x[SeasonMin-0]
|
||||
_ = x[SeasonSpring-1]
|
||||
_ = x[SeasonSummer-2]
|
||||
_ = x[SeasonFall-3]
|
||||
_ = x[SeasonWinter-4]
|
||||
_ = x[SeasonCherryBlossom-5]
|
||||
_ = x[SeasonMax-6]
|
||||
}
|
||||
|
||||
const _Season_name = "MinSpringSummerFallWinterCherryBlossomMax"
|
||||
|
||||
var _Season_index = [...]uint8{0, 3, 9, 15, 19, 25, 38, 41}
|
||||
|
||||
func (i Season) String() string {
|
||||
idx := int(i) - 0
|
||||
if i < 0 || idx >= len(_Season_index)-1 {
|
||||
return "Season(" + strconv.FormatInt(int64(i), 10) + ")"
|
||||
}
|
||||
return _Season_name[_Season_index[idx]:_Season_index[idx+1]]
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
@@ -0,0 +1,27 @@
|
||||
// Code generated by "stringer -type TurfVisionType -trimprefix TurfVision"; DO NOT EDIT.
|
||||
|
||||
package replay
|
||||
|
||||
import "strconv"
|
||||
|
||||
func _() {
|
||||
// An "invalid array index" compiler error signifies that the constant values have changed.
|
||||
// Re-run the stringer command to generate them again.
|
||||
var x [1]struct{}
|
||||
_ = x[TurfVisionURA-1]
|
||||
_ = x[TurfVisionNAU-2]
|
||||
_ = x[TurfVisionStand-3]
|
||||
_ = x[turfVisionMax-4]
|
||||
}
|
||||
|
||||
const _TurfVisionType_name = "URANAUStandturfVisionMax"
|
||||
|
||||
var _TurfVisionType_index = [...]uint8{0, 3, 6, 11, 24}
|
||||
|
||||
func (i TurfVisionType) String() string {
|
||||
idx := int(i) - 1
|
||||
if i < 1 || idx >= len(_TurfVisionType_index)-1 {
|
||||
return "TurfVisionType(" + strconv.FormatInt(int64(i), 10) + ")"
|
||||
}
|
||||
return _TurfVisionType_name[_TurfVisionType_index[idx]:_TurfVisionType_index[idx+1]]
|
||||
}
|
||||
Reference in New Issue
Block a user