import Scene from "../views/Scene";
import SceneCtrl from "../ctrls/sceneCtrl";
import { ModuleTypes } from "../types/sceneTypes";
import PanelCtrl from "../ctrls/panelCtrl";
import StartScene from '../startScene/StartScene';
import { NetManager } from "../../libs/tw/manager/NetManager";
import { DataManager } from "../../libs/tw/manager/DataManager";
import Loading from "../loading/Loading";
import { Buried } from "../../libs/tw/util/Buried";

export default class ResultScene extends Scene {


    public get skinKey() { return 'ResultScene' }
    public get groupName() { return 'result_scene' }

    constructor(data?) {
        super(data);
    }

    initEvents() {
        super.initEvents();

    }

    removeEvents() {
        super.removeEvents();

    }


  

    protected onSkinComplete(): void {
        super.onSkinComplete();

        this.once(egret.Event.ADDED_TO_STAGE, this.onLoad, this);
        if (this.stage) {
            this.onLoad();
        }
    }


    protected async preLoadRes() {
        //加载背景并设置背景图片

        return new Promise(function (resolve, reject) {
            resolve();
        });
    }

    start(data?) {
        super.start(data);
        this.percentHeight = 100;
    }

    private onLoad(): void {
        this.initUI();
     
    }

   

    private initUI():void{
    }

    //打乱数组顺序
    private shuffleArray(array) {
        for (var i = array.length - 1; i > 0; i--) {
            var j = Math.floor(Math.random() * (i + 1));
            var temp = array[i];
            array[i] = array[j];
            array[j] = temp;
        }
        return array;
    }
}

export interface IResultData{
    persona:string,
    author:string,
    msg:string,
    bookName:string,
    pnaDes:string
}