import { Verify } from '@/utils/verify/verify';


/**
 * 作为赢单结束
 *
 * @export
 * @class WinLogicBase
 */
export default class WinLogicBase {

    /**
     * 名称
     * 
     * @memberof  WinLogicBase
     */
    private name:string ="Win";

    /**
     * 唯一标识
     * 
     * @memberof  WinLogicBase
     */
    private id:string = "67643EA0-5920-48F8-8411-251152430059";

    /**
     * 默认参数名称
     * 
     * @memberof  WinLogicBase
     */
    private defaultParamName:string = "Default";

    /**
     * 参数集合
     * 
     * @memberof  WinLogicBase
     */
    private paramsMap:Map<string,any> = new Map();

    /**
     * Creates an instance of  WinLogicBase.
     * 
     * @param {*} [opts={}]
     * @memberof  WinLogicBase
     */
    constructor(opts: any = {}) {
        this.initParams(opts);
    }

    /**
     * 初始化参数集合
     * 
     * @param {*} [opts={}]
     * @memberof  WinLogicBase
     */
    public initParams(opts:any){
        this.paramsMap.set('Default',opts);
    }


    /**
     * 执行逻辑
     * 
     * @param context 应用上下文
     * @param params 传入参数
     */
    public onExecute(context:any,params:any,isloading:boolean){
        return this.executeBegin(context,params,isloading);
    }


    /**
    * 开始
    * 
    * @param params 传入参数
    */
    private async executeBegin(context:any,params:any,isloading:boolean){
        //开始节点
        return this.paramsMap.get(this.defaultParamName).data;
    }


}