import { Spec, _Class } from "./Types"

export type SpecT = {
    Warrior : 'Arms' | 'Fury' | 'Protection'
    Rogue: 'Subetly' | 'Combat' | 'Assassination'
    Hunter: 'Beast Mastery' | 'Marksmanship' | 'Survival'
    Paladin: 'Holy' | 'Protection' | 'Retribution'
    Priest: 'Discipline' | 'Holy' | 'Shadow'
    Druid: 'Feral (Tank)' | 'Feral (DPS)' | 'Restoration' | 'Balance'
    Mage: 'Frost' | 'Arcane' | 'Fire'
    Warlock: 'Demonology' | 'Destruction' | 'Affliction'
    Shaman: 'Restoration' | 'Enhancement' | 'Elemental'
}

export const specs : { [classname in keyof SpecT] : SpecT[classname][] } = {
    Warrior : [
        'Arms',
        'Fury',
        'Protection'
    ],

    Rogue: [
        'Subetly',
        'Combat',
        'Assassination'
    ],

    Hunter: [
        'Beast Mastery',
        'Marksmanship',
        'Survival'
    ],

    Paladin: [
        'Holy',
        'Protection',
        'Retribution'
    ],

    Priest: [
        'Discipline',
        'Holy',
        'Shadow'
    ],

    Druid: [
        'Feral (Tank)',
        'Feral (DPS)',
        'Restoration',
        'Balance'
    ],

    Mage: [
        'Frost',
        'Arcane',
        'Fire'
    ],

    Warlock: [
        'Demonology',
        'Destruction',
        'Affliction'
    ],

    Shaman: [
        'Restoration',
        'Enhancement',
        'Elemental'
    ],
}

export function getSpecTableData() : Spec[]{
    return _Class.flatMap((_class) => {
        const specNames : string[] = specs[_class]
        return specNames.map(specName => {
            return {
                name: specName,
                class: _class
            }
        })
    })
}