From c7288eec388b3b9923d25752cf19e877ce0ef81f Mon Sep 17 00:00:00 2001 From: Intyre Date: Fri, 18 Dec 2020 07:40:54 +0100 Subject: [PATCH 1/6] Cleanup d2records logging --- d2core/d2records/armor_type_loader.go | 2 +- d2core/d2records/automagic_loader.go | 2 +- d2core/d2records/automap_loader.go | 2 +- d2core/d2records/belts_loader.go | 2 +- d2core/d2records/body_locations_loader.go | 2 +- d2core/d2records/books_loader.go | 4 ++-- d2core/d2records/books_record.go | 8 ++++---- d2core/d2records/calculations_loader.go | 12 ++++-------- d2core/d2records/charstats_loader.go | 2 +- d2core/d2records/color_loader.go | 2 +- d2core/d2records/component_codes_loader.go | 2 +- d2core/d2records/composite_type_loader.go | 2 +- d2core/d2records/cube_modifier_loader.go | 2 +- d2core/d2records/cube_type_loader.go | 2 +- d2core/d2records/cubemain_loader.go | 2 +- d2core/d2records/difficultylevels_loader.go | 2 +- d2core/d2records/elemtype_loader.go | 2 +- d2core/d2records/events_loader.go | 2 +- d2core/d2records/experience_loader.go | 4 ++-- d2core/d2records/experience_record.go | 6 +++--- d2core/d2records/gamble_loader.go | 2 +- d2core/d2records/gems_loader.go | 6 +++--- d2core/d2records/gems_record.go | 8 ++++---- d2core/d2records/hireling_description_loader.go | 2 +- d2core/d2records/hireling_loader.go | 2 +- d2core/d2records/hit_class_loader.go | 2 +- d2core/d2records/inventory_loader.go | 2 +- d2core/d2records/item_affix_loader.go | 2 +- d2core/d2records/item_armor_loader.go | 2 +- d2core/d2records/item_low_quality_loader.go | 2 +- d2core/d2records/item_misc_loader.go | 2 +- d2core/d2records/item_quality_loader.go | 2 +- d2core/d2records/item_ratio_loader.go | 2 +- d2core/d2records/item_types_loader.go | 2 +- d2core/d2records/item_weapons_loader.go | 2 +- d2core/d2records/itemstatcost_loader.go | 2 +- d2core/d2records/level_details_loader.go | 4 ++-- d2core/d2records/level_details_record.go | 8 ++++---- d2core/d2records/level_maze_loader.go | 4 ++-- d2core/d2records/level_maze_record.go | 8 ++++---- d2core/d2records/level_presets_loader.go | 2 +- d2core/d2records/level_substitutions_loader.go | 2 +- d2core/d2records/level_types_loader.go | 2 +- d2core/d2records/level_warp_loader.go | 2 +- d2core/d2records/missiles_loader.go | 2 +- d2core/d2records/monster_ai_loader.go | 2 +- d2core/d2records/monster_equipment_loader.go | 2 +- d2core/d2records/monster_levels_record.go | 2 +- d2core/d2records/monster_mode_loader.go | 2 +- d2core/d2records/monster_mode_record.go | 2 +- d2core/d2records/monster_placement_loader.go | 2 +- d2core/d2records/monster_preset_loader.go | 2 +- d2core/d2records/monster_property_loader.go | 2 +- d2core/d2records/monster_sequence_loader.go | 2 +- d2core/d2records/monster_sound_loader.go | 2 +- d2core/d2records/monster_stats2_loader.go | 2 +- d2core/d2records/monster_stats_loader.go | 2 +- d2core/d2records/monster_super_unique_loader.go | 2 +- d2core/d2records/monster_type_loader.go | 2 +- d2core/d2records/monster_unique_affix_loader.go | 4 ++-- d2core/d2records/monster_unique_modifiers_loader.go | 2 +- d2core/d2records/npc_loader.go | 2 +- d2core/d2records/object_details_loader.go | 2 +- d2core/d2records/object_groups_loader.go | 2 +- d2core/d2records/object_mode_loader.go | 2 +- d2core/d2records/object_types_loader.go | 2 +- d2core/d2records/overlays_loader.go | 2 +- d2core/d2records/pet_type_loader.go | 2 +- d2core/d2records/player_class_loader.go | 2 +- d2core/d2records/player_mode_loader.go | 2 +- d2core/d2records/player_type_loader.go | 2 +- d2core/d2records/property_loader.go | 2 +- d2core/d2records/rare_prefix_loader.go | 2 +- d2core/d2records/rare_suffix_loader.go | 2 +- d2core/d2records/record_manager.go | 4 ++-- d2core/d2records/runeword_loader.go | 8 ++++---- d2core/d2records/runeword_record.go | 8 ++++---- d2core/d2records/set_item_loader.go | 2 +- d2core/d2records/set_loader.go | 2 +- d2core/d2records/shrine_loader.go | 2 +- d2core/d2records/skill_description_loader.go | 2 +- d2core/d2records/skill_details_loader.go | 2 +- d2core/d2records/sound_details_loader.go | 2 +- d2core/d2records/sound_environment_loader.go | 2 +- d2core/d2records/states_loader.go | 2 +- d2core/d2records/storepage_loader.go | 2 +- d2core/d2records/treasure_class_loader.go | 4 ++-- d2core/d2records/unique_appellation_loader.go | 2 +- d2core/d2records/unique_items_loader.go | 2 +- d2core/d2records/weapon_class_loader.go | 2 +- 90 files changed, 122 insertions(+), 126 deletions(-) diff --git a/d2core/d2records/armor_type_loader.go b/d2core/d2records/armor_type_loader.go index 612e0481..30a2b0fc 100644 --- a/d2core/d2records/armor_type_loader.go +++ b/d2core/d2records/armor_type_loader.go @@ -22,7 +22,7 @@ func armorTypesLoader(r *RecordManager, d *d2txt.DataDictionary) error { r.Animation.Token.Armor = records - r.Logger.Infof("Loaded %d ArmorType records", len(records)) + r.Debugf("Loaded %d ArmorType records", len(records)) return nil } diff --git a/d2core/d2records/automagic_loader.go b/d2core/d2records/automagic_loader.go index b666c96a..cb66cef8 100644 --- a/d2core/d2records/automagic_loader.go +++ b/d2core/d2records/automagic_loader.go @@ -79,7 +79,7 @@ func autoMagicLoader(r *RecordManager, d *d2txt.DataDictionary) error { return d.Err } - r.Logger.Infof("Loaded %d AutoMagic records", len(records)) + r.Debugf("Loaded %d AutoMagic records", len(records)) r.Item.AutoMagic = records diff --git a/d2core/d2records/automap_loader.go b/d2core/d2records/automap_loader.go index fe33002c..69f26ad5 100644 --- a/d2core/d2records/automap_loader.go +++ b/d2core/d2records/automap_loader.go @@ -37,7 +37,7 @@ func autoMapLoader(r *RecordManager, d *d2txt.DataDictionary) error { return d.Err } - r.Logger.Infof("Loaded %d AutoMapRecord records", len(records)) + r.Debugf("Loaded %d AutoMap records", len(records)) r.Level.AutoMaps = records diff --git a/d2core/d2records/belts_loader.go b/d2core/d2records/belts_loader.go index ba954718..622f8dec 100644 --- a/d2core/d2records/belts_loader.go +++ b/d2core/d2records/belts_loader.go @@ -102,7 +102,7 @@ func beltsLoader(r *RecordManager, d *d2txt.DataDictionary) error { return d.Err } - r.Logger.Infof("Loaded %d belts", len(records)) + r.Debugf("Loaded %d Belt records", len(records)) r.Item.Belts = records diff --git a/d2core/d2records/body_locations_loader.go b/d2core/d2records/body_locations_loader.go index 70c9855e..6b660c74 100644 --- a/d2core/d2records/body_locations_loader.go +++ b/d2core/d2records/body_locations_loader.go @@ -19,7 +19,7 @@ func bodyLocationsLoader(r *RecordManager, d *d2txt.DataDictionary) error { panic(d.Err) } - r.Logger.Infof("Loaded %d Body Location records", len(records)) + r.Debugf("Loaded %d BodyLocation records", len(records)) r.BodyLocations = records diff --git a/d2core/d2records/books_loader.go b/d2core/d2records/books_loader.go index 9b8c46fa..866f3228 100644 --- a/d2core/d2records/books_loader.go +++ b/d2core/d2records/books_loader.go @@ -8,7 +8,7 @@ func booksLoader(r *RecordManager, d *d2txt.DataDictionary) error { records := make(Books) for d.Next() { - record := &BooksRecord{ + record := &BookRecord{ Name: d.String("Name"), Namco: d.String("Namco"), Completed: d.String("Completed"), @@ -28,7 +28,7 @@ func booksLoader(r *RecordManager, d *d2txt.DataDictionary) error { panic(d.Err) } - r.Logger.Infof("Loaded %d book items", len(records)) + r.Debugf("Loaded %d Book records", len(records)) r.Item.Books = records diff --git a/d2core/d2records/books_record.go b/d2core/d2records/books_record.go index 119185d7..472179ea 100644 --- a/d2core/d2records/books_record.go +++ b/d2core/d2records/books_record.go @@ -1,10 +1,10 @@ package d2records -// Books stores all of the BooksRecords -type Books map[string]*BooksRecord +// Books stores all of the BookRecords +type Books map[string]*BookRecord -// BooksRecord is a representation of a row from books.txt -type BooksRecord struct { +// BookRecord is a representation of a row from books.txt +type BookRecord struct { Name string Namco string // The displayed name, where the string prefix is "Tome" Completed string diff --git a/d2core/d2records/calculations_loader.go b/d2core/d2records/calculations_loader.go index bc3330cb..3a07677f 100644 --- a/d2core/d2records/calculations_loader.go +++ b/d2core/d2records/calculations_loader.go @@ -5,32 +5,28 @@ import ( ) func skillCalcLoader(r *RecordManager, d *d2txt.DataDictionary) error { - records, err := loadCalculations(r, d) + records, err := loadCalculations(r, d, "Skill") if err != nil { return err } - r.Logger.Infof("Loaded %d Skill Calculation records", len(records)) - r.Calculation.Skills = records return nil } func missileCalcLoader(r *RecordManager, d *d2txt.DataDictionary) error { - records, err := loadCalculations(r, d) + records, err := loadCalculations(r, d, "Missile") if err != nil { return err } - r.Logger.Infof("Loaded %d Missile Calculation records", len(records)) - r.Calculation.Missiles = records return nil } -func loadCalculations(r *RecordManager, d *d2txt.DataDictionary) (Calculations, error) { +func loadCalculations(r *RecordManager, d *d2txt.DataDictionary, name string) (Calculations, error) { records := make(Calculations) for d.Next() { @@ -45,7 +41,7 @@ func loadCalculations(r *RecordManager, d *d2txt.DataDictionary) (Calculations, return nil, d.Err } - r.Logger.Infof("Loaded %d Skill Calculation records", len(records)) + r.Debugf("Loaded %d %s Calculation records", len(records), name) return records, nil } diff --git a/d2core/d2records/charstats_loader.go b/d2core/d2records/charstats_loader.go index b5af365d..2fd0b78f 100644 --- a/d2core/d2records/charstats_loader.go +++ b/d2core/d2records/charstats_loader.go @@ -136,7 +136,7 @@ func charStatsLoader(r *RecordManager, d *d2txt.DataDictionary) error { return d.Err } - r.Logger.Infof("Loaded %d CharStats records", len(records)) + r.Debugf("Loaded %d CharStat records", len(records)) r.Character.Stats = records diff --git a/d2core/d2records/color_loader.go b/d2core/d2records/color_loader.go index 1f2c502a..2adb67cc 100644 --- a/d2core/d2records/color_loader.go +++ b/d2core/d2records/color_loader.go @@ -22,7 +22,7 @@ func colorsLoader(r *RecordManager, d *d2txt.DataDictionary) error { r.Colors = records - r.Logger.Infof("Loaded %d Color records", len(records)) + r.Debugf("Loaded %d Color records", len(records)) return nil } diff --git a/d2core/d2records/component_codes_loader.go b/d2core/d2records/component_codes_loader.go index 6a840f4b..af02f09d 100644 --- a/d2core/d2records/component_codes_loader.go +++ b/d2core/d2records/component_codes_loader.go @@ -19,7 +19,7 @@ func componentCodesLoader(r *RecordManager, d *d2txt.DataDictionary) error { return d.Err } - r.Logger.Infof("Loaded %d ComponentCode records", len(records)) + r.Debugf("Loaded %d ComponentCode records", len(records)) r.ComponentCodes = records diff --git a/d2core/d2records/composite_type_loader.go b/d2core/d2records/composite_type_loader.go index c60ed58c..ecb5c4ea 100644 --- a/d2core/d2records/composite_type_loader.go +++ b/d2core/d2records/composite_type_loader.go @@ -22,7 +22,7 @@ func compositeTypeLoader(r *RecordManager, d *d2txt.DataDictionary) error { r.Animation.Token.Composite = records - r.Logger.Infof("Loaded %d Composite Type records", len(records)) + r.Debugf("Loaded %d CompositeType records", len(records)) return nil } diff --git a/d2core/d2records/cube_modifier_loader.go b/d2core/d2records/cube_modifier_loader.go index f9ddc7fa..18e25847 100644 --- a/d2core/d2records/cube_modifier_loader.go +++ b/d2core/d2records/cube_modifier_loader.go @@ -22,7 +22,7 @@ func cubeModifierLoader(r *RecordManager, d *d2txt.DataDictionary) error { r.Item.Cube.Modifiers = records - r.Logger.Infof("Loaded %d Cube Modifier records", len(records)) + r.Debugf("Loaded %d CubeModifier records", len(records)) return nil } diff --git a/d2core/d2records/cube_type_loader.go b/d2core/d2records/cube_type_loader.go index 18bbf171..b79551f6 100644 --- a/d2core/d2records/cube_type_loader.go +++ b/d2core/d2records/cube_type_loader.go @@ -22,7 +22,7 @@ func cubeTypeLoader(r *RecordManager, d *d2txt.DataDictionary) error { r.Item.Cube.Types = records - r.Logger.Infof("Loaded %d Cube Type records", len(records)) + r.Debugf("Loaded %d CubeType records", len(records)) return nil } diff --git a/d2core/d2records/cubemain_loader.go b/d2core/d2records/cubemain_loader.go index 76692521..01d61e40 100644 --- a/d2core/d2records/cubemain_loader.go +++ b/d2core/d2records/cubemain_loader.go @@ -96,7 +96,7 @@ func cubeRecipeLoader(r *RecordManager, d *d2txt.DataDictionary) error { return d.Err } - r.Logger.Infof("Loaded %d CubeMainRecord records", len(records)) + r.Debugf("Loaded %d CubeRecipe records", len(records)) r.Item.Cube.Recipes = records diff --git a/d2core/d2records/difficultylevels_loader.go b/d2core/d2records/difficultylevels_loader.go index c880e1e5..c048b2cd 100644 --- a/d2core/d2records/difficultylevels_loader.go +++ b/d2core/d2records/difficultylevels_loader.go @@ -42,7 +42,7 @@ func difficultyLevelsLoader(r *RecordManager, d *d2txt.DataDictionary) error { return d.Err } - r.Logger.Infof("Loaded %d DifficultyLevel records", len(records)) + r.Debugf("Loaded %d DifficultyLevel records", len(records)) r.DifficultyLevels = records diff --git a/d2core/d2records/elemtype_loader.go b/d2core/d2records/elemtype_loader.go index 7142a0ac..863dd712 100644 --- a/d2core/d2records/elemtype_loader.go +++ b/d2core/d2records/elemtype_loader.go @@ -20,7 +20,7 @@ func elemTypesLoader(r *RecordManager, d *d2txt.DataDictionary) error { return d.Err } - r.Logger.Infof("Loaded %d ElemType records", len(records)) + r.Debugf("Loaded %d ElemType records", len(records)) r.ElemTypes = records diff --git a/d2core/d2records/events_loader.go b/d2core/d2records/events_loader.go index 08db2485..4af88bbc 100644 --- a/d2core/d2records/events_loader.go +++ b/d2core/d2records/events_loader.go @@ -20,7 +20,7 @@ func eventsLoader(r *RecordManager, d *d2txt.DataDictionary) error { return d.Err } - r.Logger.Infof("Loaded %d Event records", len(records)) + r.Debugf("Loaded %d Event records", len(records)) r.Character.Events = records diff --git a/d2core/d2records/experience_loader.go b/d2core/d2records/experience_loader.go index 7380420f..5ef9b922 100644 --- a/d2core/d2records/experience_loader.go +++ b/d2core/d2records/experience_loader.go @@ -48,7 +48,7 @@ func experienceLoader(r *RecordManager, d *d2txt.DataDictionary) error { } for d.Next() { - record := &ExperienceBreakpointsRecord{ + record := &ExperienceBreakpointRecord{ Level: d.Number("Level"), HeroBreakpoints: map[d2enum.Hero]int{ d2enum.HeroAmazon: d.Number("Amazon"), @@ -68,7 +68,7 @@ func experienceLoader(r *RecordManager, d *d2txt.DataDictionary) error { return d.Err } - r.Logger.Infof("Loaded %d Experience Breakpoint records", len(breakpoints)) + r.Debugf("Loaded %d ExperienceBreakpoint records", len(breakpoints)) r.Character.MaxLevel = maxLevels r.Character.Experience = breakpoints diff --git a/d2core/d2records/experience_record.go b/d2core/d2records/experience_record.go index 9b80b0e4..821122a5 100644 --- a/d2core/d2records/experience_record.go +++ b/d2core/d2records/experience_record.go @@ -4,14 +4,14 @@ import "github.com/OpenDiablo2/OpenDiablo2/d2common/d2enum" // ExperienceBreakpoints describes the required experience // for each level for each character class -type ExperienceBreakpoints map[int]*ExperienceBreakpointsRecord +type ExperienceBreakpoints map[int]*ExperienceBreakpointRecord // ExperienceMaxLevels defines the max character levels type ExperienceMaxLevels map[d2enum.Hero]int -// ExperienceBreakpointsRecord describes the experience points required to +// ExperienceBreakpointRecord describes the experience points required to // gain a level for all character classes -type ExperienceBreakpointsRecord struct { +type ExperienceBreakpointRecord struct { Level int HeroBreakpoints map[d2enum.Hero]int Ratio int diff --git a/d2core/d2records/gamble_loader.go b/d2core/d2records/gamble_loader.go index dda7ac08..7fce2967 100644 --- a/d2core/d2records/gamble_loader.go +++ b/d2core/d2records/gamble_loader.go @@ -19,7 +19,7 @@ func gambleLoader(r *RecordManager, d *d2txt.DataDictionary) error { return d.Err } - r.Logger.Infof("Loaded %d gamble records", len(records)) + r.Debugf("Loaded %d Gamble records", len(records)) r.Gamble = records diff --git a/d2core/d2records/gems_loader.go b/d2core/d2records/gems_loader.go index bc71b23a..5db90827 100644 --- a/d2core/d2records/gems_loader.go +++ b/d2core/d2records/gems_loader.go @@ -4,12 +4,12 @@ import ( "github.com/OpenDiablo2/OpenDiablo2/d2common/d2fileformats/d2txt" ) -// LoadGems loads gem records into a map[string]*GemsRecord +// LoadGems loads gem records into a map[string]*GemRecord func gemsLoader(r *RecordManager, d *d2txt.DataDictionary) error { records := make(Gems) for d.Next() { - gem := &GemsRecord{ + gem := &GemRecord{ Name: d.String("name"), Letter: d.String("letter"), Transform: d.Number("transform"), @@ -60,7 +60,7 @@ func gemsLoader(r *RecordManager, d *d2txt.DataDictionary) error { return d.Err } - r.Logger.Infof("Loaded %d Gems records", len(records)) + r.Debugf("Loaded %d Gem records", len(records)) r.Item.Gems = records diff --git a/d2core/d2records/gems_record.go b/d2core/d2records/gems_record.go index 62879a00..cbb69e76 100644 --- a/d2core/d2records/gems_record.go +++ b/d2core/d2records/gems_record.go @@ -1,11 +1,11 @@ package d2records -// Gems stores all of the GemsRecords -type Gems map[string]*GemsRecord +// Gems stores all of the GemRecords +type Gems map[string]*GemRecord -// GemsRecord is a representation of a single row of gems.txt +// GemRecord is a representation of a single row of gems.txt // it describes the properties of socketable items -type GemsRecord struct { +type GemRecord struct { Name string Letter string Transform int diff --git a/d2core/d2records/hireling_description_loader.go b/d2core/d2records/hireling_description_loader.go index fa6c7d0c..e289f9d2 100644 --- a/d2core/d2records/hireling_description_loader.go +++ b/d2core/d2records/hireling_description_loader.go @@ -22,7 +22,7 @@ func hirelingDescriptionLoader(r *RecordManager, d *d2txt.DataDictionary) error r.Hireling.Descriptions = records - r.Logger.Infof("Loaded %d Hireling Descriptions records", len(records)) + r.Debugf("Loaded %d HirelingDescription records", len(records)) return nil } diff --git a/d2core/d2records/hireling_loader.go b/d2core/d2records/hireling_loader.go index c1262988..785d7f76 100644 --- a/d2core/d2records/hireling_loader.go +++ b/d2core/d2records/hireling_loader.go @@ -90,7 +90,7 @@ func hirelingLoader(r *RecordManager, d *d2txt.DataDictionary) error { return d.Err } - r.Logger.Infof("Loaded %d Hireling records", len(records)) + r.Debugf("Loaded %d Hireling records", len(records)) r.Hireling.Details = records diff --git a/d2core/d2records/hit_class_loader.go b/d2core/d2records/hit_class_loader.go index 0c265066..68c98d47 100644 --- a/d2core/d2records/hit_class_loader.go +++ b/d2core/d2records/hit_class_loader.go @@ -22,7 +22,7 @@ func hitClassLoader(r *RecordManager, d *d2txt.DataDictionary) error { r.Animation.Token.HitClass = records - r.Logger.Infof("Loaded %d HitClass records", len(records)) + r.Debugf("Loaded %d HitClass records", len(records)) return nil } diff --git a/d2core/d2records/inventory_loader.go b/d2core/d2records/inventory_loader.go index cbe0974c..931c81fe 100644 --- a/d2core/d2records/inventory_loader.go +++ b/d2core/d2records/inventory_loader.go @@ -130,7 +130,7 @@ func inventoryLoader(r *RecordManager, d *d2txt.DataDictionary) error { return d.Err } - r.Logger.Infof("Loaded %d Inventory Panel records", len(records)) + r.Debugf("Loaded %d Inventory records", len(records)) r.Layout.Inventory = records diff --git a/d2core/d2records/item_affix_loader.go b/d2core/d2records/item_affix_loader.go index 2b0f7999..09f1608d 100644 --- a/d2core/d2records/item_affix_loader.go +++ b/d2core/d2records/item_affix_loader.go @@ -70,7 +70,7 @@ func loadAffixDictionary( } name := getAffixString(superType, subType) - r.Logger.Infof("Loaded %d %s records", len(records), name) + r.Debugf("Loaded %d %s records", len(records), name) return records, groups, nil } diff --git a/d2core/d2records/item_armor_loader.go b/d2core/d2records/item_armor_loader.go index 2023f7fd..d910e964 100644 --- a/d2core/d2records/item_armor_loader.go +++ b/d2core/d2records/item_armor_loader.go @@ -16,7 +16,7 @@ func armorLoader(r *RecordManager, d *d2txt.DataDictionary) error { return err } - r.Logger.Infof("Loaded %d armors", len(records)) + r.Debugf("Loaded %d Armor Item records", len(records)) r.Item.Armors = records diff --git a/d2core/d2records/item_low_quality_loader.go b/d2core/d2records/item_low_quality_loader.go index eb8b99bf..ec491780 100644 --- a/d2core/d2records/item_low_quality_loader.go +++ b/d2core/d2records/item_low_quality_loader.go @@ -21,7 +21,7 @@ func lowQualityLoader(r *RecordManager, d *d2txt.DataDictionary) error { r.Item.LowQualityPrefixes = records - r.Logger.Infof("Loaded %d Low Item Quality records", len(records)) + r.Debugf("Loaded %d LowQuality records", len(records)) return nil } diff --git a/d2core/d2records/item_misc_loader.go b/d2core/d2records/item_misc_loader.go index 0851fd08..957abeaa 100644 --- a/d2core/d2records/item_misc_loader.go +++ b/d2core/d2records/item_misc_loader.go @@ -13,7 +13,7 @@ func miscItemsLoader(r *RecordManager, d *d2txt.DataDictionary) error { return err } - r.Logger.Infof("Loaded %d misc items", len(records)) + r.Debugf("Loaded %d Misc Item records", len(records)) r.Item.Misc = records diff --git a/d2core/d2records/item_quality_loader.go b/d2core/d2records/item_quality_loader.go index f3d92e74..e497376d 100644 --- a/d2core/d2records/item_quality_loader.go +++ b/d2core/d2records/item_quality_loader.go @@ -45,7 +45,7 @@ func itemQualityLoader(r *RecordManager, d *d2txt.DataDictionary) error { r.Item.Quality = records - r.Logger.Infof("Loaded %d ItemQualities records", len(records)) + r.Debugf("Loaded %d ItemQuality records", len(records)) return nil } diff --git a/d2core/d2records/item_ratio_loader.go b/d2core/d2records/item_ratio_loader.go index 06e460b7..bc47202f 100644 --- a/d2core/d2records/item_ratio_loader.go +++ b/d2core/d2records/item_ratio_loader.go @@ -55,7 +55,7 @@ func itemRatioLoader(r *RecordManager, d *d2txt.DataDictionary) error { return d.Err } - r.Logger.Infof("Loaded %d ItemRatio records", len(records)) + r.Debugf("Loaded %d ItemRatio records", len(records)) r.Item.Ratios = records diff --git a/d2core/d2records/item_types_loader.go b/d2core/d2records/item_types_loader.go index 258791f3..e278e0b6 100644 --- a/d2core/d2records/item_types_loader.go +++ b/d2core/d2records/item_types_loader.go @@ -76,7 +76,7 @@ func itemTypesLoader(r *RecordManager, d *d2txt.DataDictionary) error { return d.Err } - r.Logger.Infof("Loaded %d ItemType records", len(records)) + r.Debugf("Loaded %d ItemType records", len(records)) r.Item.Types = records r.Item.Equivalency = equivMap diff --git a/d2core/d2records/item_weapons_loader.go b/d2core/d2records/item_weapons_loader.go index dfd9e2cd..cbc12d56 100644 --- a/d2core/d2records/item_weapons_loader.go +++ b/d2core/d2records/item_weapons_loader.go @@ -13,7 +13,7 @@ func weaponsLoader(r *RecordManager, d *d2txt.DataDictionary) error { return err } - r.Logger.Infof("Loaded %d weapons", len(records)) + r.Debugf("Loaded %d Weapon records", len(records)) r.Item.Weapons = records diff --git a/d2core/d2records/itemstatcost_loader.go b/d2core/d2records/itemstatcost_loader.go index ed4c328a..e4f38f76 100644 --- a/d2core/d2records/itemstatcost_loader.go +++ b/d2core/d2records/itemstatcost_loader.go @@ -95,7 +95,7 @@ func itemStatCostLoader(r *RecordManager, d *d2txt.DataDictionary) error { return d.Err } - r.Logger.Infof("Loaded %d ItemStatCost records", len(records)) + r.Debugf("Loaded %d ItemStatCost records", len(records)) r.Item.Stats = records diff --git a/d2core/d2records/level_details_loader.go b/d2core/d2records/level_details_loader.go index e53722ff..5591523b 100644 --- a/d2core/d2records/level_details_loader.go +++ b/d2core/d2records/level_details_loader.go @@ -11,7 +11,7 @@ func levelDetailsLoader(r *RecordManager, d *d2txt.DataDictionary) error { records := make(LevelDetails) for d.Next() { - record := &LevelDetailsRecord{ + record := &LevelDetailRecord{ Name: d.String("Name "), ID: d.Number("Id"), Palette: d.Number("Pal"), @@ -165,7 +165,7 @@ func levelDetailsLoader(r *RecordManager, d *d2txt.DataDictionary) error { return d.Err } - r.Logger.Infof("Loaded %d LevelDetails records", len(records)) + r.Debugf("Loaded %d LevelDetail records", len(records)) r.Level.Details = records diff --git a/d2core/d2records/level_details_record.go b/d2core/d2records/level_details_record.go index db9430b2..386882e5 100644 --- a/d2core/d2records/level_details_record.go +++ b/d2core/d2records/level_details_record.go @@ -2,13 +2,13 @@ package d2records import "github.com/OpenDiablo2/OpenDiablo2/d2common/d2enum" -// LevelDetails has all of the LevelDetailsRecords -type LevelDetails map[int]*LevelDetailsRecord +// LevelDetails has all of the LevelDetailRecords +type LevelDetails map[int]*LevelDetailRecord -// LevelDetailsRecord is a representation of a row from levels.txt +// LevelDetailRecord is a representation of a row from levels.txt // it describes lots of things about the levels, like where they are connected, // what kinds of monsters spawn, the level generator type, and lots of other stuff. -type LevelDetailsRecord struct { +type LevelDetailRecord struct { // Name // This column has no function, it only serves as a comment field to make it diff --git a/d2core/d2records/level_maze_loader.go b/d2core/d2records/level_maze_loader.go index 8c592922..0b6edd6a 100644 --- a/d2core/d2records/level_maze_loader.go +++ b/d2core/d2records/level_maze_loader.go @@ -8,7 +8,7 @@ func levelMazeDetailsLoader(r *RecordManager, d *d2txt.DataDictionary) error { records := make(LevelMazeDetails) for d.Next() { - record := &LevelMazeDetailsRecord{ + record := &LevelMazeDetailRecord{ Name: d.String("Name"), LevelID: d.Number("Level"), NumRoomsNormal: d.Number("Rooms"), @@ -24,7 +24,7 @@ func levelMazeDetailsLoader(r *RecordManager, d *d2txt.DataDictionary) error { return d.Err } - r.Logger.Infof("Loaded %d LevelMazeDetails records", len(records)) + r.Debugf("Loaded %d LevelMazeDetail records", len(records)) r.Level.Maze = records diff --git a/d2core/d2records/level_maze_record.go b/d2core/d2records/level_maze_record.go index 61877e5b..b47dfee3 100644 --- a/d2core/d2records/level_maze_record.go +++ b/d2core/d2records/level_maze_record.go @@ -1,11 +1,11 @@ package d2records -// LevelMazeDetails stores all of the LevelMazeDetailsRecords -type LevelMazeDetails map[int]*LevelMazeDetailsRecord +// LevelMazeDetails stores all of the LevelMazeDetailRecords +type LevelMazeDetails map[int]*LevelMazeDetailRecord -// LevelMazeDetailsRecord is a representation of a row from lvlmaze.txt +// LevelMazeDetailRecord is a representation of a row from lvlmaze.txt // these records define the parameters passed to the maze level generator -type LevelMazeDetailsRecord struct { +type LevelMazeDetailRecord struct { // descriptive, not loaded in game. Corresponds with Name field in // Levels.txt Name string // Name diff --git a/d2core/d2records/level_presets_loader.go b/d2core/d2records/level_presets_loader.go index 8cd32ea6..39847d6b 100644 --- a/d2core/d2records/level_presets_loader.go +++ b/d2core/d2records/level_presets_loader.go @@ -42,7 +42,7 @@ func levelPresetLoader(r *RecordManager, d *d2txt.DataDictionary) error { records[record.DefinitionID] = record } - r.Logger.Infof("Loaded %d level presets", len(records)) + r.Debugf("Loaded %d LevelPresets records", len(records)) if d.Err != nil { return d.Err diff --git a/d2core/d2records/level_substitutions_loader.go b/d2core/d2records/level_substitutions_loader.go index 3eacde9c..0b0059a8 100644 --- a/d2core/d2records/level_substitutions_loader.go +++ b/d2core/d2records/level_substitutions_loader.go @@ -40,7 +40,7 @@ func levelSubstitutionsLoader(r *RecordManager, d *d2txt.DataDictionary) error { return d.Err } - r.Logger.Infof("Loaded %d LevelSubstitution records", len(records)) + r.Debugf("Loaded %d LevelSubstitution records", len(records)) r.Level.Sub = records diff --git a/d2core/d2records/level_types_loader.go b/d2core/d2records/level_types_loader.go index 160a621c..8ff4cabd 100644 --- a/d2core/d2records/level_types_loader.go +++ b/d2core/d2records/level_types_loader.go @@ -58,7 +58,7 @@ func levelTypesLoader(r *RecordManager, d *d2txt.DataDictionary) error { return d.Err } - r.Logger.Infof("Loaded %d LevelType records", len(records)) + r.Debugf("Loaded %d LevelType records", len(records)) r.Level.Types = records diff --git a/d2core/d2records/level_warp_loader.go b/d2core/d2records/level_warp_loader.go index f474f94a..84bc6964 100644 --- a/d2core/d2records/level_warp_loader.go +++ b/d2core/d2records/level_warp_loader.go @@ -30,7 +30,7 @@ func levelWarpsLoader(r *RecordManager, d *d2txt.DataDictionary) error { return d.Err } - r.Logger.Infof("Loaded %d level warps", len(records)) + r.Debugf("Loaded %d LevelWarp records", len(records)) r.Level.Warp = records diff --git a/d2core/d2records/missiles_loader.go b/d2core/d2records/missiles_loader.go index 6183c2fb..807e88e5 100644 --- a/d2core/d2records/missiles_loader.go +++ b/d2core/d2records/missiles_loader.go @@ -304,7 +304,7 @@ func missilesLoader(r *RecordManager, d *d2txt.DataDictionary) error { return d.Err } - r.Logger.Infof("Loaded %d Missile Records", len(records)) + r.Debugf("Loaded %d Missile records", len(records)) r.Missiles = records diff --git a/d2core/d2records/monster_ai_loader.go b/d2core/d2records/monster_ai_loader.go index 5f89565e..47841eea 100644 --- a/d2core/d2records/monster_ai_loader.go +++ b/d2core/d2records/monster_ai_loader.go @@ -19,7 +19,7 @@ func monsterAiLoader(r *RecordManager, d *d2txt.DataDictionary) error { return d.Err } - r.Logger.Infof("Loaded %d MonsterAI records", len(records)) + r.Debugf("Loaded %d MonsterAI records", len(records)) r.Monster.AI = records diff --git a/d2core/d2records/monster_equipment_loader.go b/d2core/d2records/monster_equipment_loader.go index 5639649a..0e4b800a 100644 --- a/d2core/d2records/monster_equipment_loader.go +++ b/d2core/d2records/monster_equipment_loader.go @@ -49,7 +49,7 @@ func monsterEquipmentLoader(r *RecordManager, d *d2txt.DataDictionary) error { length += len(records[k]) } - r.Logger.Infof("Loaded %d MonsterEquipment records", length) + r.Debugf("Loaded %d MonsterEquipment records", length) r.Monster.Equipment = records diff --git a/d2core/d2records/monster_levels_record.go b/d2core/d2records/monster_levels_record.go index 89bb71f9..6b71e601 100644 --- a/d2core/d2records/monster_levels_record.go +++ b/d2core/d2records/monster_levels_record.go @@ -52,7 +52,7 @@ func monsterLevelsLoader(r *RecordManager, d *d2txt.DataDictionary) error { return d.Err } - r.Logger.Infof("Loaded %d MonsterLevel records", len(records)) + r.Debugf("Loaded %d MonsterLevel records", len(records)) r.Monster.Levels = records diff --git a/d2core/d2records/monster_mode_loader.go b/d2core/d2records/monster_mode_loader.go index 23e512fb..41cb4adf 100644 --- a/d2core/d2records/monster_mode_loader.go +++ b/d2core/d2records/monster_mode_loader.go @@ -21,7 +21,7 @@ func monsterModeLoader(r *RecordManager, d *d2txt.DataDictionary) error { return d.Err } - r.Logger.Infof("Loaded %d MonMode records", len(records)) + r.Debugf("Loaded %d MonMode records", len(records)) r.Monster.Modes = records diff --git a/d2core/d2records/monster_mode_record.go b/d2core/d2records/monster_mode_record.go index 7a36ff05..9df79421 100644 --- a/d2core/d2records/monster_mode_record.go +++ b/d2core/d2records/monster_mode_record.go @@ -1,6 +1,6 @@ package d2records -// MonModes stores all of the GemsRecords +// MonModes stores all of the MonModeRecords type MonModes map[string]*MonModeRecord // MonModeRecord is a representation of a single row of Monmode.txt diff --git a/d2core/d2records/monster_placement_loader.go b/d2core/d2records/monster_placement_loader.go index a1e56df0..adfbb8e4 100644 --- a/d2core/d2records/monster_placement_loader.go +++ b/d2core/d2records/monster_placement_loader.go @@ -18,7 +18,7 @@ func monsterPlacementsLoader(r *RecordManager, d *d2txt.DataDictionary) error { r.Monster.Placements = records - r.Logger.Infof("Loaded %d MonsterPlacement records", len(records)) + r.Debugf("Loaded %d MonsterPlacement records", len(records)) return nil } diff --git a/d2core/d2records/monster_preset_loader.go b/d2core/d2records/monster_preset_loader.go index c2e84ea3..d9380549 100644 --- a/d2core/d2records/monster_preset_loader.go +++ b/d2core/d2records/monster_preset_loader.go @@ -21,7 +21,7 @@ func monsterPresetLoader(r *RecordManager, d *d2txt.DataDictionary) error { return d.Err } - r.Logger.Infof("Loaded %d MonPreset records", len(records)) + r.Debugf("Loaded %d MonPreset records", len(records)) r.Monster.Presets = records diff --git a/d2core/d2records/monster_property_loader.go b/d2core/d2records/monster_property_loader.go index 0662c40d..b3e63c3c 100644 --- a/d2core/d2records/monster_property_loader.go +++ b/d2core/d2records/monster_property_loader.go @@ -57,7 +57,7 @@ func monsterPropertiesLoader(r *RecordManager, d *d2txt.DataDictionary) error { return d.Err } - r.Logger.Infof("Loaded %d MonProp records", len(records)) + r.Debugf("Loaded %d MonProp records", len(records)) r.Monster.Props = records diff --git a/d2core/d2records/monster_sequence_loader.go b/d2core/d2records/monster_sequence_loader.go index 449c6b3e..e168fe1d 100644 --- a/d2core/d2records/monster_sequence_loader.go +++ b/d2core/d2records/monster_sequence_loader.go @@ -31,7 +31,7 @@ func monsterSequencesLoader(r *RecordManager, d *d2txt.DataDictionary) error { return d.Err } - r.Logger.Infof("Loaded %d MonsterSequence records", len(records)) + r.Debugf("Loaded %d MonsterSequence records", len(records)) r.Monster.Sequences = records diff --git a/d2core/d2records/monster_sound_loader.go b/d2core/d2records/monster_sound_loader.go index 96b6909c..3f8aa3f2 100644 --- a/d2core/d2records/monster_sound_loader.go +++ b/d2core/d2records/monster_sound_loader.go @@ -57,7 +57,7 @@ func monsterSoundsLoader(r *RecordManager, d *d2txt.DataDictionary) error { return d.Err } - r.Logger.Infof("Loaded %d Monster Sound records", len(records)) + r.Debugf("Loaded %d MonsterSound records", len(records)) r.Monster.Sounds = records diff --git a/d2core/d2records/monster_stats2_loader.go b/d2core/d2records/monster_stats2_loader.go index 51981d27..8d092ac5 100644 --- a/d2core/d2records/monster_stats2_loader.go +++ b/d2core/d2records/monster_stats2_loader.go @@ -161,7 +161,7 @@ func monsterStats2Loader(r *RecordManager, d *d2txt.DataDictionary) error { panic(d.Err) } - r.Logger.Infof("Loaded %d MonStats2 records", len(records)) + r.Debugf("Loaded %d MonStat2 records", len(records)) r.Monster.Stats2 = records diff --git a/d2core/d2records/monster_stats_loader.go b/d2core/d2records/monster_stats_loader.go index a6b8c6a9..e2c7cf14 100644 --- a/d2core/d2records/monster_stats_loader.go +++ b/d2core/d2records/monster_stats_loader.go @@ -272,7 +272,7 @@ func monsterStatsLoader(r *RecordManager, d *d2txt.DataDictionary) error { return d.Err } - r.Logger.Infof("Loaded %d MonStats records", len(records)) + r.Debugf("Loaded %d MonStat records", len(records)) r.Monster.Stats = records diff --git a/d2core/d2records/monster_super_unique_loader.go b/d2core/d2records/monster_super_unique_loader.go index 774bb77a..852c0f25 100644 --- a/d2core/d2records/monster_super_unique_loader.go +++ b/d2core/d2records/monster_super_unique_loader.go @@ -40,7 +40,7 @@ func monsterSuperUniqeLoader(r *RecordManager, d *d2txt.DataDictionary) error { r.Monster.Unique.Super = records - r.Logger.Infof("Loaded %d SuperUnique records", len(records)) + r.Debugf("Loaded %d SuperUnique records", len(records)) return nil } diff --git a/d2core/d2records/monster_type_loader.go b/d2core/d2records/monster_type_loader.go index 75f2fd0d..d4635af9 100644 --- a/d2core/d2records/monster_type_loader.go +++ b/d2core/d2records/monster_type_loader.go @@ -23,7 +23,7 @@ func monsterTypesLoader(r *RecordManager, d *d2txt.DataDictionary) error { panic(d.Err) } - r.Logger.Infof("Loaded %d MonType records", len(records)) + r.Debugf("Loaded %d MonType records", len(records)) r.Monster.Types = records diff --git a/d2core/d2records/monster_unique_affix_loader.go b/d2core/d2records/monster_unique_affix_loader.go index cfe6f497..0061926a 100644 --- a/d2core/d2records/monster_unique_affix_loader.go +++ b/d2core/d2records/monster_unique_affix_loader.go @@ -59,7 +59,7 @@ func uniqueMonsterPrefixLoader(r *RecordManager, d *d2txt.DataDictionary) error r.Monster.Name.Prefix = records - r.Logger.Infof("Loaded %d unique monster prefix records", len(records)) + r.Debugf("Loaded %d UniqueMonsterPrefix records", len(records)) return nil } @@ -72,7 +72,7 @@ func uniqueMonsterSuffixLoader(r *RecordManager, d *d2txt.DataDictionary) error r.Monster.Name.Suffix = records - r.Logger.Infof("Loaded %d unique monster suffix records", len(records)) + r.Debugf("Loaded %d UniqueMonsterSuffix records", len(records)) return nil } diff --git a/d2core/d2records/monster_unique_modifiers_loader.go b/d2core/d2records/monster_unique_modifiers_loader.go index 949d0ef4..3da4aec3 100644 --- a/d2core/d2records/monster_unique_modifiers_loader.go +++ b/d2core/d2records/monster_unique_modifiers_loader.go @@ -48,7 +48,7 @@ func monsterUniqModifiersLoader(r *RecordManager, d *d2txt.DataDictionary) error return d.Err } - r.Logger.Infof("Loaded %d MonsterUniqueModifier records", len(records)) + r.Debugf("Loaded %d MonsterUniqueModifier records", len(records)) r.Monster.Unique.Mods = records r.Monster.Unique.Constants = constants diff --git a/d2core/d2records/npc_loader.go b/d2core/d2records/npc_loader.go index 685a3a5c..ebf9a590 100644 --- a/d2core/d2records/npc_loader.go +++ b/d2core/d2records/npc_loader.go @@ -64,7 +64,7 @@ func npcLoader(r *RecordManager, d *d2txt.DataDictionary) error { r.NPCs = records - r.Logger.Infof("Loaded %d NPC records", len(records)) + r.Debugf("Loaded %d NPC records", len(records)) return nil } diff --git a/d2core/d2records/object_details_loader.go b/d2core/d2records/object_details_loader.go index c7dca4c6..1e4bb850 100644 --- a/d2core/d2records/object_details_loader.go +++ b/d2core/d2records/object_details_loader.go @@ -225,7 +225,7 @@ func objectDetailsLoader(r *RecordManager, d *d2txt.DataDictionary) error { return d.Err } - r.Logger.Infof("Loaded %d objects", len(records)) + r.Debugf("Loaded %d ObjectDetail records", len(records)) r.Object.Details = records diff --git a/d2core/d2records/object_groups_loader.go b/d2core/d2records/object_groups_loader.go index 8a4ee9c7..ed109cfd 100644 --- a/d2core/d2records/object_groups_loader.go +++ b/d2core/d2records/object_groups_loader.go @@ -32,7 +32,7 @@ func objectGroupsLoader(r *RecordManager, d *d2txt.DataDictionary) error { return d.Err } - r.Logger.Infof("Loaded %d ObjectGroup records", len(records)) + r.Debugf("Loaded %d ObjectGroup records", len(records)) return nil } diff --git a/d2core/d2records/object_mode_loader.go b/d2core/d2records/object_mode_loader.go index dc544360..39c40ae2 100644 --- a/d2core/d2records/object_mode_loader.go +++ b/d2core/d2records/object_mode_loader.go @@ -22,7 +22,7 @@ func objectModesLoader(r *RecordManager, d *d2txt.DataDictionary) error { r.Object.Modes = records - r.Logger.Infof("Loaded %d ObjectMode records", len(records)) + r.Debugf("Loaded %d ObjectMode records", len(records)) return nil } diff --git a/d2core/d2records/object_types_loader.go b/d2core/d2records/object_types_loader.go index fdb9f7bd..aa855a96 100644 --- a/d2core/d2records/object_types_loader.go +++ b/d2core/d2records/object_types_loader.go @@ -23,7 +23,7 @@ func objectTypesLoader(r *RecordManager, d *d2txt.DataDictionary) error { return d.Err } - r.Logger.Infof("Loaded %d object types", len(records)) + r.Debugf("Loaded %d ObjectType records", len(records)) r.Object.Types = records diff --git a/d2core/d2records/overlays_loader.go b/d2core/d2records/overlays_loader.go index aed7a028..a10344ab 100644 --- a/d2core/d2records/overlays_loader.go +++ b/d2core/d2records/overlays_loader.go @@ -35,7 +35,7 @@ func overlaysLoader(r *RecordManager, d *d2txt.DataDictionary) error { return d.Err } - r.Logger.Infof("Loaded %d Overlay records", len(records)) + r.Debugf("Loaded %d Overlay records", len(records)) r.Layout.Overlays = records diff --git a/d2core/d2records/pet_type_loader.go b/d2core/d2records/pet_type_loader.go index 59d9f4a9..b8000f1d 100644 --- a/d2core/d2records/pet_type_loader.go +++ b/d2core/d2records/pet_type_loader.go @@ -39,7 +39,7 @@ func petTypesLoader(r *RecordManager, d *d2txt.DataDictionary) error { return d.Err } - r.Logger.Infof("Loaded %d PetType records", len(records)) + r.Debugf("Loaded %d PetType records", len(records)) r.PetTypes = records diff --git a/d2core/d2records/player_class_loader.go b/d2core/d2records/player_class_loader.go index df6321ce..3eff68be 100644 --- a/d2core/d2records/player_class_loader.go +++ b/d2core/d2records/player_class_loader.go @@ -29,7 +29,7 @@ func playerClassLoader(r *RecordManager, d *d2txt.DataDictionary) error { return d.Err } - r.Logger.Infof("Loaded %d PlayerClass records", len(records)) + r.Debugf("Loaded %d PlayerClass records", len(records)) r.Character.Classes = records diff --git a/d2core/d2records/player_mode_loader.go b/d2core/d2records/player_mode_loader.go index 9274759f..010876c1 100644 --- a/d2core/d2records/player_mode_loader.go +++ b/d2core/d2records/player_mode_loader.go @@ -23,7 +23,7 @@ func playerModesLoader(r *RecordManager, d *d2txt.DataDictionary) error { r.Character.Modes = records - r.Logger.Infof("Loaded %d PlayerMode records", len(records)) + r.Debugf("Loaded %d PlayerMode records", len(records)) return nil } diff --git a/d2core/d2records/player_type_loader.go b/d2core/d2records/player_type_loader.go index e383df9a..60b7e2c3 100644 --- a/d2core/d2records/player_type_loader.go +++ b/d2core/d2records/player_type_loader.go @@ -24,7 +24,7 @@ func playerTypeLoader(r *RecordManager, d *d2txt.DataDictionary) error { panic(d.Err) } - r.Logger.Infof("Loaded %d PlayerType records", len(records)) + r.Debugf("Loaded %d PlayerType records", len(records)) r.Animation.Token.Player = records diff --git a/d2core/d2records/property_loader.go b/d2core/d2records/property_loader.go index db718319..e68b1708 100644 --- a/d2core/d2records/property_loader.go +++ b/d2core/d2records/property_loader.go @@ -67,7 +67,7 @@ func propertyLoader(r *RecordManager, d *d2txt.DataDictionary) error { r.Properties = records - r.Logger.Infof("Loaded %d Property records", len(records)) + r.Debugf("Loaded %d Property records", len(records)) return nil } diff --git a/d2core/d2records/rare_prefix_loader.go b/d2core/d2records/rare_prefix_loader.go index 290eccf4..65512d0f 100644 --- a/d2core/d2records/rare_prefix_loader.go +++ b/d2core/d2records/rare_prefix_loader.go @@ -12,7 +12,7 @@ func rareItemPrefixLoader(r *RecordManager, d *d2txt.DataDictionary) error { r.Item.Rare.Prefix = records - r.Logger.Infof("Loaded %d RarePrefix records", len(records)) + r.Debugf("Loaded %d RarePrefix records", len(records)) return nil } diff --git a/d2core/d2records/rare_suffix_loader.go b/d2core/d2records/rare_suffix_loader.go index fb158cb7..94123695 100644 --- a/d2core/d2records/rare_suffix_loader.go +++ b/d2core/d2records/rare_suffix_loader.go @@ -10,7 +10,7 @@ func rareItemSuffixLoader(r *RecordManager, d *d2txt.DataDictionary) error { return err } - r.Logger.Infof("Loaded %d RareSuffix records", len(records)) + r.Debugf("Loaded %d RareSuffix records", len(records)) r.Item.Rare.Suffix = records diff --git a/d2core/d2records/record_manager.go b/d2core/d2records/record_manager.go index 716a4f4d..adf342a0 100644 --- a/d2core/d2records/record_manager.go +++ b/d2core/d2records/record_manager.go @@ -334,8 +334,8 @@ func (r *RecordManager) GetExperienceBreakpoint(heroType d2enum.Hero, level int) return r.Character.Experience[level].HeroBreakpoints[heroType] } -// GetLevelDetails gets a LevelDetailsRecord by the record Id -func (r *RecordManager) GetLevelDetails(id int) *LevelDetailsRecord { +// GetLevelDetails gets a LevelDetailRecord by the record Id +func (r *RecordManager) GetLevelDetails(id int) *LevelDetailRecord { for i := 0; i < len(r.Level.Details); i++ { if r.Level.Details[i].ID == id { return r.Level.Details[i] diff --git a/d2core/d2records/runeword_loader.go b/d2core/d2records/runeword_loader.go index e498fe2d..a367d9d2 100644 --- a/d2core/d2records/runeword_loader.go +++ b/d2core/d2records/runeword_loader.go @@ -24,12 +24,12 @@ const ( fmtRunewordPropMax = "T1Max%d" ) -// Loadrecords loads runes records into a map[string]*RunesRecord +// Loadrecords loads runes records into a map[string]*RuneRecord func runewordLoader(r *RecordManager, d *d2txt.DataDictionary) error { - records := make(map[string]*RunesRecord) + records := make(map[string]*RuneRecord) for d.Next() { - record := &RunesRecord{ + record := &RuneRecord{ Name: d.String("name"), RuneName: d.String("Rune Name"), Complete: d.Bool("complete"), @@ -89,7 +89,7 @@ func runewordLoader(r *RecordManager, d *d2txt.DataDictionary) error { r.Item.Runewords = records - r.Logger.Infof("Loaded %d records records", len(records)) + r.Debugf("Loaded %d Rune records", len(records)) return nil } diff --git a/d2core/d2records/runeword_record.go b/d2core/d2records/runeword_record.go index cfd63461..7041a018 100644 --- a/d2core/d2records/runeword_record.go +++ b/d2core/d2records/runeword_record.go @@ -1,11 +1,11 @@ package d2records -// Runewords stores all of the RunesRecords -type Runewords map[string]*RunesRecord +// Runewords stores all of the RuneRecords +type Runewords map[string]*RuneRecord -// RunesRecord is a representation of a single row of runes.txt. It defines +// RuneRecord is a representation of a single row of runes.txt. It defines // runewords available in the game. -type RunesRecord struct { +type RuneRecord struct { Name string RuneName string // More of a note - the actual name should be read from the TBL files. Complete bool // An enabled/disabled flag. Only "Complete" runewords work in game. diff --git a/d2core/d2records/set_item_loader.go b/d2core/d2records/set_item_loader.go index e1dfff03..88021cbf 100644 --- a/d2core/d2records/set_item_loader.go +++ b/d2core/d2records/set_item_loader.go @@ -94,7 +94,7 @@ func setItemLoader(r *RecordManager, d *d2txt.DataDictionary) error { r.Item.SetItems = records - r.Logger.Infof("Loaded %d SetItem records", len(records)) + r.Debugf("Loaded %d SetItem records", len(records)) return nil } diff --git a/d2core/d2records/set_loader.go b/d2core/d2records/set_loader.go index 8babd544..5ac03637 100644 --- a/d2core/d2records/set_loader.go +++ b/d2core/d2records/set_loader.go @@ -107,7 +107,7 @@ func setLoader(r *RecordManager, d *d2txt.DataDictionary) error { r.Item.Sets = records - r.Logger.Infof("Loaded %d records records", len(records)) + r.Debugf("Loaded %d Set records", len(records)) return nil } diff --git a/d2core/d2records/shrine_loader.go b/d2core/d2records/shrine_loader.go index 7d143032..2aedf9bc 100644 --- a/d2core/d2records/shrine_loader.go +++ b/d2core/d2records/shrine_loader.go @@ -31,7 +31,7 @@ func shrineLoader(r *RecordManager, d *d2txt.DataDictionary) error { r.Object.Shrines = records - r.Logger.Infof("Loaded %d shrines", len(records)) + r.Debugf("Loaded %d Shrine records", len(records)) return nil } diff --git a/d2core/d2records/skill_description_loader.go b/d2core/d2records/skill_description_loader.go index 5eb1b96e..f579a8d5 100644 --- a/d2core/d2records/skill_description_loader.go +++ b/d2core/d2records/skill_description_loader.go @@ -139,7 +139,7 @@ func skillDescriptionLoader(r *RecordManager, d *d2txt.DataDictionary) error { r.Skill.Descriptions = records - r.Logger.Infof("Loaded %d Skill Description records", len(records)) + r.Debugf("Loaded %d SkillDescription records", len(records)) return nil } diff --git a/d2core/d2records/skill_details_loader.go b/d2core/d2records/skill_details_loader.go index da790eed..6067cc4c 100644 --- a/d2core/d2records/skill_details_loader.go +++ b/d2core/d2records/skill_details_loader.go @@ -277,7 +277,7 @@ func skillDetailsLoader(r *RecordManager, d *d2txt.DataDictionary) error { r.Skill.Details = records - r.Logger.Infof("Loaded %d Skill records", len(records)) + r.Debugf("Loaded %d Skill records", len(records)) return nil } diff --git a/d2core/d2records/sound_details_loader.go b/d2core/d2records/sound_details_loader.go index ff62077f..77f9330f 100644 --- a/d2core/d2records/sound_details_loader.go +++ b/d2core/d2records/sound_details_loader.go @@ -46,7 +46,7 @@ func soundDetailsLoader(r *RecordManager, d *d2txt.DataDictionary) error { r.Sound.Details = records - r.Logger.Infof("Loaded %d sound definitions", len(records)) + r.Debugf("Loaded %d SoundDetail records", len(records)) return nil } diff --git a/d2core/d2records/sound_environment_loader.go b/d2core/d2records/sound_environment_loader.go index 98c6bdea..68562ccc 100644 --- a/d2core/d2records/sound_environment_loader.go +++ b/d2core/d2records/sound_environment_loader.go @@ -44,7 +44,7 @@ func soundEnvironmentLoader(r *RecordManager, d *d2txt.DataDictionary) error { r.Sound.Environment = records - r.Logger.Infof("Loaded %d SoundEnviron records", len(records)) + r.Debugf("Loaded %d SoundEnviron records", len(records)) return nil } diff --git a/d2core/d2records/states_loader.go b/d2core/d2records/states_loader.go index 21798f82..b7724b3a 100644 --- a/d2core/d2records/states_loader.go +++ b/d2core/d2records/states_loader.go @@ -89,7 +89,7 @@ func statesLoader(r *RecordManager, d *d2txt.DataDictionary) error { r.States = records - r.Logger.Infof("Loaded %d State records", len(records)) + r.Debugf("Loaded %d State records", len(records)) return nil } diff --git a/d2core/d2records/storepage_loader.go b/d2core/d2records/storepage_loader.go index 67655354..f66a422b 100644 --- a/d2core/d2records/storepage_loader.go +++ b/d2core/d2records/storepage_loader.go @@ -21,7 +21,7 @@ func storePagesLoader(r *RecordManager, d *d2txt.DataDictionary) error { r.Item.StorePages = records - r.Logger.Infof("Loaded %d StorePage records", len(records)) + r.Debugf("Loaded %d StorePage records", len(records)) return nil } diff --git a/d2core/d2records/treasure_class_loader.go b/d2core/d2records/treasure_class_loader.go index 8f858a96..e8fdbe7a 100644 --- a/d2core/d2records/treasure_class_loader.go +++ b/d2core/d2records/treasure_class_loader.go @@ -20,7 +20,7 @@ func treasureClassLoader(r *RecordManager, d *d2txt.DataDictionary) error { r.Item.Treasure.Normal = records - r.Logger.Infof("Loaded %d treasure class (normal) records", len(records)) + r.Debugf("Loaded %d TreasureClass (normal) records", len(records)) return nil } @@ -33,7 +33,7 @@ func treasureClassExLoader(r *RecordManager, d *d2txt.DataDictionary) error { r.Item.Treasure.Expansion = records - r.Logger.Infof("Loaded %d treasure class (expansion) records", len(records)) + r.Debugf("Loaded %d TreasureClass (expansion) records", len(records)) return nil } diff --git a/d2core/d2records/unique_appellation_loader.go b/d2core/d2records/unique_appellation_loader.go index e551f901..c6d3c614 100644 --- a/d2core/d2records/unique_appellation_loader.go +++ b/d2core/d2records/unique_appellation_loader.go @@ -21,7 +21,7 @@ func uniqueAppellationsLoader(r *RecordManager, d *d2txt.DataDictionary) error { r.Monster.Unique.Appellations = records - r.Logger.Infof("Loaded %d UniqueAppellation records", len(records)) + r.Debugf("Loaded %d UniqueAppellation records", len(records)) return nil } diff --git a/d2core/d2records/unique_items_loader.go b/d2core/d2records/unique_items_loader.go index a9ae79e6..639d2dbd 100644 --- a/d2core/d2records/unique_items_loader.go +++ b/d2core/d2records/unique_items_loader.go @@ -128,7 +128,7 @@ func uniqueItemsLoader(r *RecordManager, d *d2txt.DataDictionary) error { r.Item.Unique = records - r.Logger.Infof("Loaded %d unique items", len(records)) + r.Debugf("Loaded %d UniqueItem records", len(records)) return nil } diff --git a/d2core/d2records/weapon_class_loader.go b/d2core/d2records/weapon_class_loader.go index 76154b1e..84c0b569 100644 --- a/d2core/d2records/weapon_class_loader.go +++ b/d2core/d2records/weapon_class_loader.go @@ -22,7 +22,7 @@ func weaponClassesLoader(r *RecordManager, d *d2txt.DataDictionary) error { r.Animation.Token.Weapon = records - r.Logger.Infof("Loaded %d WeaponClass records", len(records)) + r.Debugf("Loaded %d WeaponClass records", len(records)) return nil } From a62e21a5724a49e0fb716e38af9f3649dbd30ed8 Mon Sep 17 00:00:00 2001 From: Intyre Date: Fri, 18 Dec 2020 18:50:42 +0100 Subject: [PATCH 2/6] Renamed CharStatRecord --- d2core/d2hero/hero_state_factory.go | 2 +- d2core/d2hero/hero_stats_state.go | 2 +- d2core/d2item/diablo2item/item_property_test.go | 2 +- d2core/d2records/charstats_loader.go | 2 +- d2core/d2records/charstats_record.go | 8 ++++---- d2core/d2stats/diablo2stats/stat_test.go | 4 ++-- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/d2core/d2hero/hero_state_factory.go b/d2core/d2hero/hero_state_factory.go index 43ba461e..10ad1bd2 100644 --- a/d2core/d2hero/hero_state_factory.go +++ b/d2core/d2hero/hero_state_factory.go @@ -110,7 +110,7 @@ func (f *HeroStateFactory) GetAllHeroStates() ([]*HeroState, error) { } // CreateHeroSkillsState will assemble the hero skills from the class stats record. -func (f *HeroStateFactory) CreateHeroSkillsState(classStats *d2records.CharStatsRecord, heroType d2enum.Hero) (map[int]*HeroSkill, error) { +func (f *HeroStateFactory) CreateHeroSkillsState(classStats *d2records.CharStatRecord, heroType d2enum.Hero) (map[int]*HeroSkill, error) { baseSkills := map[int]*HeroSkill{} for idx := range classStats.BaseSkill { diff --git a/d2core/d2hero/hero_stats_state.go b/d2core/d2hero/hero_stats_state.go index 96400b2f..4a3f1e99 100644 --- a/d2core/d2hero/hero_stats_state.go +++ b/d2core/d2hero/hero_stats_state.go @@ -30,7 +30,7 @@ type HeroStatsState struct { } // CreateHeroStatsState generates a running state from a hero stats. -func (f *HeroStateFactory) CreateHeroStatsState(heroClass d2enum.Hero, classStats *d2records.CharStatsRecord) *HeroStatsState { +func (f *HeroStateFactory) CreateHeroStatsState(heroClass d2enum.Hero, classStats *d2records.CharStatRecord) *HeroStatsState { result := HeroStatsState{ Level: 1, Experience: 0, diff --git a/d2core/d2item/diablo2item/item_property_test.go b/d2core/d2item/diablo2item/item_property_test.go index ec932ff5..30c1d5b4 100644 --- a/d2core/d2item/diablo2item/item_property_test.go +++ b/d2core/d2item/diablo2item/item_property_test.go @@ -277,7 +277,7 @@ var itemStatCosts = map[string]*d2records.ItemStatCostRecord{ } // nolint:gochecknoglobals // just a test -var charStats = map[d2enum.Hero]*d2records.CharStatsRecord{ +var charStats = map[d2enum.Hero]*d2records.CharStatRecord{ d2enum.HeroPaladin: { Class: d2enum.HeroPaladin, SkillStrAll: "to Paladin Skill Levels", diff --git a/d2core/d2records/charstats_loader.go b/d2core/d2records/charstats_loader.go index 2fd0b78f..86f1d30a 100644 --- a/d2core/d2records/charstats_loader.go +++ b/d2core/d2records/charstats_loader.go @@ -38,7 +38,7 @@ func charStatsLoader(r *RecordManager, d *d2txt.DataDictionary) error { } for d.Next() { - record := &CharStatsRecord{ + record := &CharStatRecord{ Class: stringMap[d.String("class")], InitStr: d.Number("str"), diff --git a/d2core/d2records/charstats_record.go b/d2core/d2records/charstats_record.go index 5d7bd35d..c7717ac1 100644 --- a/d2core/d2records/charstats_record.go +++ b/d2core/d2records/charstats_record.go @@ -2,11 +2,11 @@ package d2records import "github.com/OpenDiablo2/OpenDiablo2/d2common/d2enum" -// CharStats holds all of the CharStatsRecords -type CharStats map[d2enum.Hero]*CharStatsRecord +// CharStats holds all of the CharStatRecords +type CharStats map[d2enum.Hero]*CharStatRecord -// CharStatsRecord is a struct that represents a single row from charstats.txt -type CharStatsRecord struct { +// CharStatRecord is a struct that represents a single row from charstats.txt +type CharStatRecord struct { Class d2enum.Hero // the initial stats at character level 1 diff --git a/d2core/d2stats/diablo2stats/stat_test.go b/d2core/d2stats/diablo2stats/stat_test.go index cd54927c..e6ae66e2 100644 --- a/d2core/d2stats/diablo2stats/stat_test.go +++ b/d2core/d2stats/diablo2stats/stat_test.go @@ -238,12 +238,12 @@ var skillDetails = map[int]*d2records.SkillRecord{ } // nolint:gochecknoglobals // just a test -var monStats = map[string]*d2records.MonStatsRecord{ +var monStats = map[string]*d2records.MonStatRecord{ "Specter": {NameString: "Specter", ID: 40}, } // nolint:gochecknoglobals // just a test -var charStats = map[d2enum.Hero]*d2records.CharStatsRecord{ +var charStats = map[d2enum.Hero]*d2records.CharStatRecord{ d2enum.HeroPaladin: { Class: d2enum.HeroPaladin, SkillStrAll: "to Paladin Skill Levels", From af6a8272ddfb355a598a1da2b892b43a6d297339 Mon Sep 17 00:00:00 2001 From: Intyre Date: Fri, 18 Dec 2020 18:51:41 +0100 Subject: [PATCH 3/6] Renamed SoundDetailRecord --- d2core/d2audio/sound_engine.go | 2 +- d2core/d2records/record_manager.go | 2 +- d2core/d2records/sound_details_loader.go | 2 +- d2core/d2records/sound_details_record.go | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/d2core/d2audio/sound_engine.go b/d2core/d2audio/sound_engine.go index f811c1f8..ee907af0 100644 --- a/d2core/d2audio/sound_engine.go +++ b/d2core/d2audio/sound_engine.go @@ -31,7 +31,7 @@ const originalFPS float64 = 25 // A Sound that can be started and stopped type Sound struct { effect d2interface.SoundEffect - entry *d2records.SoundDetailsRecord + entry *d2records.SoundDetailRecord volume float64 vTarget float64 vRate float64 diff --git a/d2core/d2records/record_manager.go b/d2core/d2records/record_manager.go index adf342a0..8afba41c 100644 --- a/d2core/d2records/record_manager.go +++ b/d2core/d2records/record_manager.go @@ -433,7 +433,7 @@ func (r *RecordManager) lookupObject(act, typ, id int) *ObjectLookupRecord { } // SelectSoundByIndex selects a sound by its ID -func (r *RecordManager) SelectSoundByIndex(index int) *SoundDetailsRecord { +func (r *RecordManager) SelectSoundByIndex(index int) *SoundDetailRecord { for idx := range r.Sound.Details { if r.Sound.Details[idx].Index == index { return r.Sound.Details[idx] diff --git a/d2core/d2records/sound_details_loader.go b/d2core/d2records/sound_details_loader.go index 77f9330f..b3436f0d 100644 --- a/d2core/d2records/sound_details_loader.go +++ b/d2core/d2records/sound_details_loader.go @@ -9,7 +9,7 @@ func soundDetailsLoader(r *RecordManager, d *d2txt.DataDictionary) error { records := make(SoundDetails) for d.Next() { - entry := &SoundDetailsRecord{ + entry := &SoundDetailRecord{ Handle: d.String("Sound"), Index: d.Number("Index"), FileName: d.String("FileName"), diff --git a/d2core/d2records/sound_details_record.go b/d2core/d2records/sound_details_record.go index 56de22c5..4365998a 100644 --- a/d2core/d2records/sound_details_record.go +++ b/d2core/d2records/sound_details_record.go @@ -1,10 +1,10 @@ package d2records // SoundDetails is a map of the SoundEntries -type SoundDetails map[string]*SoundDetailsRecord +type SoundDetails map[string]*SoundDetailRecord -// SoundDetailsRecord represents a sound entry -type SoundDetailsRecord struct { +// SoundDetailRecord represents a sound entry +type SoundDetailRecord struct { Handle string FileName string Index int From 2dc490b152df4a4561beae23ec8ba463dca30dc5 Mon Sep 17 00:00:00 2001 From: Intyre Date: Fri, 18 Dec 2020 18:59:29 +0100 Subject: [PATCH 4/6] Renamed MonStatRecord --- d2core/d2item/diablo2item/item_property_test.go | 2 +- d2core/d2map/d2mapentity/factory.go | 2 +- d2core/d2map/d2mapentity/npc.go | 2 +- d2core/d2records/monster_stats_loader.go | 2 +- d2core/d2records/monster_stats_record.go | 8 ++++---- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/d2core/d2item/diablo2item/item_property_test.go b/d2core/d2item/diablo2item/item_property_test.go index 30c1d5b4..bb98f697 100644 --- a/d2core/d2item/diablo2item/item_property_test.go +++ b/d2core/d2item/diablo2item/item_property_test.go @@ -297,7 +297,7 @@ var skillDetails = map[int]*d2records.SkillRecord{ } // nolint:gochecknoglobals // just a test -var monStats = map[string]*d2records.MonStatsRecord{ +var monStats = map[string]*d2records.MonStatRecord{ "Specter": {NameString: "Specter", ID: 40}, } diff --git a/d2core/d2map/d2mapentity/factory.go b/d2core/d2map/d2mapentity/factory.go index 3d42c753..527adfc6 100644 --- a/d2core/d2map/d2mapentity/factory.go +++ b/d2core/d2map/d2mapentity/factory.go @@ -180,7 +180,7 @@ func (f *MapEntityFactory) NewItem(x, y int, codes ...string) (*Item, error) { } // NewNPC creates a new NPC and returns a pointer to it. -func (f *MapEntityFactory) NewNPC(x, y int, monstat *d2records.MonStatsRecord, direction int) (*NPC, error) { +func (f *MapEntityFactory) NewNPC(x, y int, monstat *d2records.MonStatRecord, direction int) (*NPC, error) { // https://github.com/OpenDiablo2/OpenDiablo2/issues/803 result := &NPC{ mapEntity: newMapEntity(x, y), diff --git a/d2core/d2map/d2mapentity/npc.go b/d2core/d2map/d2mapentity/npc.go index 663401e0..311e7dba 100644 --- a/d2core/d2map/d2mapentity/npc.go +++ b/d2core/d2map/d2mapentity/npc.go @@ -22,8 +22,8 @@ type NPC struct { action int path int repetitions int - monstatRecord *d2records.MonStatsRecord monstatEx *d2records.MonStats2Record + monstatRecord *d2records.MonStatRecord HasPaths bool isDone bool } diff --git a/d2core/d2records/monster_stats_loader.go b/d2core/d2records/monster_stats_loader.go index e2c7cf14..e9675623 100644 --- a/d2core/d2records/monster_stats_loader.go +++ b/d2core/d2records/monster_stats_loader.go @@ -10,7 +10,7 @@ func monsterStatsLoader(r *RecordManager, d *d2txt.DataDictionary) error { records := make(MonStats) for d.Next() { - record := &MonStatsRecord{ + record := &MonStatRecord{ Key: d.String("Id"), ID: d.Number("hcIdx"), BaseKey: d.String("BaseId"), diff --git a/d2core/d2records/monster_stats_record.go b/d2core/d2records/monster_stats_record.go index 2469299a..191bb62c 100644 --- a/d2core/d2records/monster_stats_record.go +++ b/d2core/d2records/monster_stats_record.go @@ -4,13 +4,13 @@ import "github.com/OpenDiablo2/OpenDiablo2/d2common/d2enum" // https://d2mods.info/forum/kb/viewarticle?a=360 -// MonStats stores all of the MonStat Records -type MonStats map[string]*MonStatsRecord +// MonStats stores all of the MonStatRecords +type MonStats map[string]*MonStatRecord type ( - // MonStatsRecord represents a single row from `data/global/excel/monstats.txt` in the MPQ files. + // MonStatRecord represents a single row from `data/global/excel/monstats.txt` in the MPQ files. // These records are used for creating monsters. - MonStatsRecord struct { + MonStatRecord struct { // Key contains the pointer that will be used in other txt files // such as levels.txt and superuniques.txt. From 05e9f34765d78487e7bae5b47da00bc160137204 Mon Sep 17 00:00:00 2001 From: Intyre Date: Fri, 18 Dec 2020 19:02:34 +0100 Subject: [PATCH 5/6] Renamed ObjectDetailRecord --- d2core/d2map/d2mapentity/factory.go | 2 +- d2core/d2map/d2mapentity/object.go | 2 +- d2core/d2records/object_details_loader.go | 2 +- d2core/d2records/object_details_record.go | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/d2core/d2map/d2mapentity/factory.go b/d2core/d2map/d2mapentity/factory.go index 527adfc6..2b400b3f 100644 --- a/d2core/d2map/d2mapentity/factory.go +++ b/d2core/d2map/d2mapentity/factory.go @@ -263,7 +263,7 @@ func (f *MapEntityFactory) NewCastOverlay(x, y int, overlayRecord *d2records.Ove } // NewObject creates an instance of AnimatedComposite -func (f *MapEntityFactory) NewObject(x, y int, objectRec *d2records.ObjectDetailsRecord, +func (f *MapEntityFactory) NewObject(x, y int, objectRec *d2records.ObjectDetailRecord, palettePath string) (*Object, error) { locX, locY := float64(x), float64(y) entity := &Object{ diff --git a/d2core/d2map/d2mapentity/object.go b/d2core/d2map/d2mapentity/object.go index 71dbaf1e..314e9e04 100644 --- a/d2core/d2map/d2mapentity/object.go +++ b/d2core/d2map/d2mapentity/object.go @@ -20,7 +20,7 @@ type Object struct { composite *d2asset.Composite highlight bool // nameLabel d2ui.Label - objectRecord *d2records.ObjectDetailsRecord + objectRecord *d2records.ObjectDetailRecord drawLayer int name string } diff --git a/d2core/d2records/object_details_loader.go b/d2core/d2records/object_details_loader.go index 1e4bb850..2dcbf43d 100644 --- a/d2core/d2records/object_details_loader.go +++ b/d2core/d2records/object_details_loader.go @@ -11,7 +11,7 @@ func objectDetailsLoader(r *RecordManager, d *d2txt.DataDictionary) error { i := 0 for d.Next() { - record := &ObjectDetailsRecord{ + record := &ObjectDetailRecord{ Index: i, Name: d.String("Name"), Description: d.String("description - not loaded"), diff --git a/d2core/d2records/object_details_record.go b/d2core/d2records/object_details_record.go index ee56249a..7137cf63 100644 --- a/d2core/d2records/object_details_record.go +++ b/d2core/d2records/object_details_record.go @@ -1,10 +1,10 @@ package d2records // ObjectDetails stores all of the ObjectDetailRecords -type ObjectDetails map[int]*ObjectDetailsRecord +type ObjectDetails map[int]*ObjectDetailRecord -// ObjectDetailsRecord represents the settings for one type of object from objects.txt -type ObjectDetailsRecord struct { +// ObjectDetailRecord represents the settings for one type of object from objects.txt +type ObjectDetailRecord struct { Index int // Line number in file, this is the actual index used for objects FrameCount [8]int // how many frames does this mode have, 0 = skip FrameDelta [8]int // what rate is the animation played at (256 = 100% speed) From ec91203782900437fe2201c61b400b4ad5f1310b Mon Sep 17 00:00:00 2001 From: Intyre Date: Fri, 18 Dec 2020 19:03:13 +0100 Subject: [PATCH 6/6] Renamed MonStat2Record --- d2core/d2map/d2mapentity/npc.go | 2 +- d2core/d2records/monster_stats2_loader.go | 4 ++-- d2core/d2records/monster_stats2_record.go | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/d2core/d2map/d2mapentity/npc.go b/d2core/d2map/d2mapentity/npc.go index 311e7dba..66284092 100644 --- a/d2core/d2map/d2mapentity/npc.go +++ b/d2core/d2map/d2mapentity/npc.go @@ -22,8 +22,8 @@ type NPC struct { action int path int repetitions int - monstatEx *d2records.MonStats2Record monstatRecord *d2records.MonStatRecord + monstatEx *d2records.MonStat2Record HasPaths bool isDone bool } diff --git a/d2core/d2records/monster_stats2_loader.go b/d2core/d2records/monster_stats2_loader.go index 8d092ac5..91fc7ca0 100644 --- a/d2core/d2records/monster_stats2_loader.go +++ b/d2core/d2records/monster_stats2_loader.go @@ -7,7 +7,7 @@ import ( "github.com/OpenDiablo2/OpenDiablo2/d2common/d2fileformats/d2txt" ) -// LoadMonStats2 loads MonStats2Records from monstats2.txt +// LoadMonStats2 loads MonStat2Records from monstats2.txt //nolint:funlen //just a big data loader func monsterStats2Loader(r *RecordManager, d *d2txt.DataDictionary) error { records := make(MonStats2) @@ -18,7 +18,7 @@ func monsterStats2Loader(r *RecordManager, d *d2txt.DataDictionary) error { return err } - record := &MonStats2Record{ + record := &MonStat2Record{ Key: d.String("Id"), Height: d.Number("Height"), OverlayHeight: d.Number("OverlayHeight"), diff --git a/d2core/d2records/monster_stats2_record.go b/d2core/d2records/monster_stats2_record.go index 306ea1e4..914b1c61 100644 --- a/d2core/d2records/monster_stats2_record.go +++ b/d2core/d2records/monster_stats2_record.go @@ -2,11 +2,11 @@ package d2records import "github.com/OpenDiablo2/OpenDiablo2/d2common/d2enum" -// MonStats2 stores all of the MonStats2Records -type MonStats2 map[string]*MonStats2Record +// MonStats2 stores all of the MonStat2Records +type MonStats2 map[string]*MonStat2Record -// MonStats2Record is a representation of a row from monstats2.txt -type MonStats2Record struct { +// MonStat2Record is a representation of a row from monstats2.txt +type MonStat2Record struct { // Available options for equipment // randomly selected from EquipmentOptions [16][]string