import { _decorator, Component, Node } from 'cc';
import JNScrollViewItem from '../../../../../extensions/ngame/assets/ngame/util/components/scrollview/JNScrollViewItem';
import { ModeOnHookRankingOV } from '../../../consts/API';
import { Label } from 'cc';
import { TD } from '../../../App';
import GOnHookData from '../../../data/GOnHookData';
import { TbGEntity } from '../../../config/data/schema';
const { ccclass, property } = _decorator;

@ccclass('OnHookRinkingItem')
export class OnHookRinkingItem extends JNScrollViewItem<ModeOnHookRankingOV> {

    //排名
    @property(Label)
    rinking:Label;

    //玩家名称
    @property(Label)
    playerName:Label;

    //关卡名称
    @property(Label)
    levelName:Label;

    onInit(myData:ModeOnHookRankingOV){
        this.data = myData;

        this.rinking.string = `${this.data.rank}`;
        this.playerName.string = `${this.data.playerName}`;
        
        let table:{data:TbGEntity.TOnHookLevel} = TD[TD.TbGOnHookMaps.get(this.data.mapId)?.sign].get(this.data.levelId);
        if(table)
            this.levelName.string = `难度 : ${table.data.level}-${table.data.childLevel}`;

    }

}


