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


export class RankKfjs_1 extends Rank {
    ctype: string;

    get ortype() {
        return `kfjs${kfjsFun.getStatus().type}`
    }

    getType(): rankType {
        return <rankType>`kfjs1`;
    }

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

export class RankKfjs_2 extends RankKfjs_1 {
    getType(): rankType {
        return <rankType>`kfjs2`;
    }
}

export class RankKfjs_3 extends RankKfjs_1 {
    getType(): rankType {
        return <rankType>`kfjs3`;
    }
}

export class RankKfjs_4 extends RankKfjs_1 {
    getType(): rankType {
        return <rankType>`kfjs4`;
    }
}


export class RankKfjs_5 extends RankKfjs_1 {
    getType(): rankType {
        return <rankType>`kfjs5`;
    }
}


export class RankKfjs_6 extends RankKfjs_1 {
    getType(): rankType {
        return <rankType>`kfjs6`;
    }
}

export class RankKfjs_7 extends RankKfjs_1 {
    getType(): rankType {
        return <rankType>`kfjs7`;
    }
}


export function RankKfjs(type: number) {
    return <RankKfjs_1>Rank.list[`kfjs${type}`]
}