//公共结构体和枚举

export enum ScrollViewEventMap {
    "scroll-to-top" = 0,
    "scroll-to-bottom" = 1,
    "scroll-to-left" = 2,
    "scroll-to-right" = 3,
    "scrolling" = 4,
    "bounce-bottom" = 6,
    "bounce-left" = 7,
    "bounce-right" = 8,
    "bounce-top" = 5,
    "scroll-ended" = 9,
    "touch-up" = 10,
    "scroll-ended-with-threshold" = 11,
    "scroll-began" = 12,
}

// /** 公告 */
export interface BulletinEnum {
    content: string;       //公告内容
    img: null;        //公告图片；可空
}

/** 弹窗类型 */
export enum TipsOpereteEnum {
    yes = 0,
    yes_no = 1
}

/** 物品类型 */
export enum ItemEnum {
    user = "user",       //货币
    material = "material",       //材料
    equip = "equip",          //装备
    role = "role",          //英雄
}
export enum LanguageType {
    Zh = "Zh",
    En = "En",
}
export interface BaseItem {
    conf: {};
    id: string;
    count: number;
    type: ItemEnum;
}

// 奖品[物品类型(ItemEnum),物品编号，物品数量]  []
export type AwardData = [string, string, number]
/** 装备部位 */
export enum EquipSlotEnum {
    weapon = 1,     //武器
    helmet = 2,     //头盔
    armor = 3,      //盔甲
    jewelry = 4,    //首饰
}

/** 属性类型 */
export enum AttrAddTypeEnum {
    reality = 1,     //实际加成
    percent = 2,     //百分比加成
}


export enum AttrEnum {
    attack = 'attack',
    defence = 'defence',
    hp = 'hp',
    speed = 'speed',
    broken = 'broken',
    power = 'power',
    hp_p = 'hp_p',
    attack_p = 'attack_p',
    defence_p = 'defence_p',
    hit = 'hit',
    miss = 'miss',
    crite = 'crite',
    decrite = 'decrite',
    critedamage = 'critedamage',
    adddamage = 'adddamage',
    dedamage = 'dedamage',
    suck = 'suck',
    thorns = 'thorns',
    block = 'block',
}

export interface AttrBaseData{
    [AttrEnum.attack]:number;
    [AttrEnum.defence]:number;
    [AttrEnum.hp]:number;
    [AttrEnum.speed]:number;
    [AttrEnum.broken]:number;
    [AttrEnum.power]:number;
    [AttrEnum.hp_p]:number;
    [AttrEnum.attack_p]:number;
    [AttrEnum.defence_p]:number;
    [AttrEnum.hit]:number;
    [AttrEnum.miss]:number;
    [AttrEnum.crite]:number;
    [AttrEnum.decrite]:number;
    [AttrEnum.critedamage]:number;
    [AttrEnum.adddamage]:number;
    [AttrEnum.dedamage]:number;
    [AttrEnum.suck]:number;
    [AttrEnum.thorns]:number;
    [AttrEnum.block]:number;
    
}

/** 属性 */
export const AttrConf = {
    [AttrEnum.attack]: { type: AttrAddTypeEnum.reality, name: "攻击", desc: "攻击", url: "attack_ico" },
    [AttrEnum.defence]: { type: AttrAddTypeEnum.reality, name: "防御", desc: "防御", url: "defence_ico" },
    [AttrEnum.hp]: { type: AttrAddTypeEnum.reality, name: "生命", desc: "生命", url: "hp_ico" },
    [AttrEnum.speed]: { type: AttrAddTypeEnum.reality, name: "速度", desc: "速度", url: "speed_ico" },
    [AttrEnum.broken]: { type: AttrAddTypeEnum.reality, name: "破甲", desc: "破甲", url: "broken_ico" },
    [AttrEnum.power]: { type: AttrAddTypeEnum.reality, name: "士气", desc: "士气", url: "power_ico" },
    [AttrEnum.hp_p]: { type: AttrAddTypeEnum.percent, name: "生命加成", desc: "生命加成", url: "hp_p_ico" },
    [AttrEnum.attack_p]: { type: AttrAddTypeEnum.percent, name: "攻击加成", desc: "攻击加成", url: "attack_p_ico" },
    [AttrEnum.defence_p]: { type: AttrAddTypeEnum.percent, name: "防御加成", desc: "防御加成", url: "defence_p_ico" },
    [AttrEnum.hit]: { type: AttrAddTypeEnum.percent, name: "命中率", desc: "命中率", url: "hit_ico" },
    [AttrEnum.miss]: { type: AttrAddTypeEnum.percent, name: "闪避率", desc: "闪避率", url: "miss_ico" },
    [AttrEnum.crite]: { type: AttrAddTypeEnum.percent, name: "暴击率", desc: "暴击率", url: "crite_ico" },
    [AttrEnum.decrite]: { type: AttrAddTypeEnum.percent, name: "抗暴率", desc: "抗暴率", url: "decrite_ico" },
    [AttrEnum.critedamage]: { type: AttrAddTypeEnum.percent, name: "暴击伤害", desc: "暴击伤害", url: "critedamage_ico" },
    [AttrEnum.adddamage]: { type: AttrAddTypeEnum.percent, name: "伤害加成", desc: "攻击伤害加成", url: "adddamage_ico" },
    [AttrEnum.dedamage]: { type: AttrAddTypeEnum.percent, name: "伤害减免", desc: "伤害减免", url: "dedamage_ico" },
    [AttrEnum.suck]: { type: AttrAddTypeEnum.percent, name: "吸血", desc: "吸血", url: "suck_ico" },
    [AttrEnum.thorns]: { type: AttrAddTypeEnum.percent, name: "反伤", desc: "反伤", url: "thorns_ico" },
    [AttrEnum.block]: { type: AttrAddTypeEnum.percent, name: "反伤", desc: "反伤", url: "thorns_ico" },
}