import {rankType} from '../../shared/protocols/rank/PtlOpen';
import {rankInfo} from '../../shared/protocols/type';
import {Rank} from './rank';
import kfjsFun from "../kaifujingsai";


export class RankKfjs extends Rank {

    ortype: string
    ctype: string

    constructor(ctype) {
        super();
        this.ctype = ctype
        this.ortype = `kfjs${kfjsFun.getStatus().type}`
    }

    getType(): rankType {
        let status = kfjsFun.getStatus(this.ctype)
        return <rankType>`kfjs${status.type}`;
    }

    async setDataAndCheck(info: rankInfo) {
        if (this.ortype != this.type) return
        let status = kfjsFun.getStatus(this.ctype)
        if (status.type == -1) return
        this.addNew(info)
    }
}