--[[
    Data/Families.lua

    GENERATED CONTENT — see docs/data-sources.md.
    Do not hand-edit once tools/generate_database.py exists.

    Every hunter pet family in the game. The list is not a judgement call: it is
    every row of the client's own CreatureFamily.db2 whose `PetTalentType` is
    not -1, that value marking the families that are not hunter pets at all
    (warlock demons, elementals, the QA test entry).

        PetTalentType   0 = Ferocity   1 = Tenacity   2 = Cunning   -1 = not ours

    That mapping was established by cross-checking about sixty families against
    an independent specialization list with no disagreement.

    `familyID` and `icon` come from the same table. `exotic` does not appear in
    it and comes from the specialization list cited in docs/data-sources.md.

    Written as a table plus a loop rather than sixty repeated record literals:
    every field is uniform, so the repetition would be noise, and each entry
    still goes through the same schema validation on registration.
]]

local _, ns = ...

local Registry = ns.Data.Registry
local Spec = ns.Data.Specialization
local Source = ns.Data.Source

local FEROCITY, TENACITY, CUNNING = Spec.FEROCITY, Spec.TENACITY, Spec.CUNNING

-- Exotic families are tameable by Beast Mastery hunters only.
local EXOTIC = { "REQ_BEAST_MASTERY" }

-- { token, familyID, specialization, iconFileID, exotic }
local FAMILIES = {
    { "WOLF",             1, FEROCITY,  132203 },
    { "CAT",              2, FEROCITY,  132185 },
    { "SPIDER",           3, FEROCITY,  132196 },
    { "BEAR",             4, TENACITY,  132183 },
    { "BOAR",             5, CUNNING,   132184 },
    { "CROCOLISK",        6, FEROCITY,  132187 },
    { "CARRION_BIRD",     7, FEROCITY,  132200 },
    { "CRAB",             8, TENACITY,  132186 },
    { "GORILLA",          9, FEROCITY,  132189 },
    { "RAPTOR",          11, CUNNING,   132193 },
    { "TALLSTRIDER",     12, FEROCITY,  132198 },
    { "SCORPID",         20, FEROCITY,  132195 },
    { "TURTLE",          21, TENACITY,  132199 },
    { "BAT",             24, FEROCITY,  132182 },
    { "HYENA",           25, CUNNING,   132190 },
    { "BIRD_OF_PREY",    26, CUNNING,   132192 },
    { "WIND_SERPENT",    27, FEROCITY,  132202 },
    { "DRAGONHAWK",      30, TENACITY,  132188 },
    { "RAVAGER",         31, FEROCITY,  132194 },
    { "WARP_STALKER",    32, CUNNING,   132201 },
    { "SPOREBAT",        33, CUNNING,   132197 },
    { "RAY",             34, FEROCITY,  132191 },
    { "SERPENT",         35, CUNNING,   136040 },
    { "MOTH",            37, CUNNING,   236193 },
    { "CHIMAERA",        38, FEROCITY,  236190, true },
    { "DEVILSAUR",       39, FEROCITY,  236192, true },
    { "AQIRI",           41, CUNNING,   236195, true },
    { "WORM",            42, TENACITY,  236197, true },
    { "CLEFTHOOF",       43, FEROCITY, 1044794, true },
    { "WASP",            44, FEROCITY,  236196 },
    { "CORE_HOUND",      45, FEROCITY,  236191, true },
    { "SPIRIT_BEAST",    46, TENACITY,  236165, true },
    { "FOX",             50, CUNNING,   458223 },
    { "MONKEY",          51, CUNNING,   877482 },
    { "HOUND",           52, CUNNING,   877481 },
    { "BEETLE",          53, TENACITY,  133570 },
    { "SHALE_BEAST",     55, CUNNING,   877478, true },
    { "HYDRA",           68, TENACITY,  463493 },
    { "WATERFOWL",      125, TENACITY,  877479 },
    { "WATER_STRIDER",  126, CUNNING,   643423, true },
    { "RODENT",         127, CUNNING,   644001 },
    { "STONE_HOUND",    128, TENACITY,  625905, true },
    { "GRUFFHORN",      129, CUNNING,   877477 },
    { "BASILISK",       130, CUNNING,   877476 },
    { "DIREHORN",       138, TENACITY,  877480 },
    { "RIVERBEAST",     150, TENACITY, 1044490 },
    { "STAG",           151, TENACITY, 1044501 },
    { "MECHANICAL",     154, CUNNING,   132247 },
    { "SCALEHIDE",      156, FEROCITY,  646378 },
    { "OXEN",           157, TENACITY,  616693 },
    { "FEATHERMANE",    160, TENACITY,  929300 },
    { "LIZARD",         288, TENACITY, 2027936 },
    { "PTERRORDAX",     290, CUNNING,  1624590, true },
    { "HOPPER",         291, TENACITY,  804969 },
    { "CARAPID",        292, TENACITY, 2011146, true },
    { "BLOOD_BEAST",    296, TENACITY, 1687702 },
    { "CAMEL",          298, CUNNING,   454771 },
    { "COURSER",        299, FEROCITY, 2143073 },
    { "MAMMOTH",        300, TENACITY,  132254 },
    { "LESSER_DRAGONKIN", 303, FEROCITY, 797547 },
    { "WHIPTAIL",       315, FEROCITY, 6966389, true },
}

for _, entry in ipairs(FAMILIES) do
    local token, familyID, specialization, icon, exotic = unpack(entry)

    Registry:RegisterFamily({
        id = token,
        familyID = familyID,
        nameKey = "FAMILY_" .. token,
        icon = icon,
        specialization = specialization,
        exotic = exotic or false,
        requirements = exotic and EXOTIC or nil,
        source = Source.DATA_REAL_VERIFIED,
    })
end
