#!/usr/bin/env python3
# this file is auto-generated by gen_from_wiki.py
from __future__ import annotations
from typing import (
    Dict,
    Tuple,
)
import enum
import functools

from ..item import EquipmentItem
from .ability import Ability


class PlayerClass(enum.Enum):

    Cleric = 'cleric'
    Warrior = 'warrior'
    Wizard = 'wizard'

    @staticmethod
    @functools.cache
    def get_abilities(cls: PlayerClass, level=10) -> Tuple[Ability, ...]:
        from .class_info import CLASS_ABILITIES
        abilities = CLASS_ABILITIES[cls]
        return tuple(
            a for a, lv in abilities.items()
            if lv <= level
        )

    @staticmethod
    @functools.cache
    def get_equipment(cls: PlayerClass, level=10) -> Tuple['EquipmentItem', ...]:
        from .class_info import CLASS_EQUIPMENT
        equipment = CLASS_EQUIPMENT[cls]
        return tuple(
            e for e, lv in equipment.items()
            if lv <= level
        )

