import { NetRequest } from "../../Engine/CatanEngine/NetManagerV2/NetRequest";

export interface RankInfo {
    t: number;
    p?: number;
    id?: number;
}

export class AppRankInfo extends NetRequest<RankInfo, JSON> {
    get Method(): string {
        return "rank.info";
    }
    constructor(Type: number, Parameter?: number) {
        super();
        this.Data = {
            t: Type,
            p: Parameter,
        };
    }
}

export class AppRankHistory extends NetRequest<RankInfo, JSON> {
    get Method(): string {
        return "rank.history";
    }
    constructor(Type: number, Parameter: number, DayId: number) {
        super();
        this.Data = {
            id: DayId,
            t: Type,
            p: Parameter
        };
    }
}

export interface RankReplayInfo {
    id: number;
    t: number;
    r: number;
    p: number;
}


export class AppRankLog extends NetRequest<RankReplayInfo, JSON> {
    get Method(): string {
        return "rank.log";
    }
    constructor(DayId: number, Type: number, rank: number, Parameter: number) {
        super();
        this.Data = {
            id: DayId,
            t: Type,
            r: rank,
            p: Parameter
        };
    }
}

export class TestAppRankLog extends NetRequest<RankReplayInfo, JSON> {
    get Method(): string {
        return "rank.log_test";
    }
    constructor(DayId: number, Type: number, rank: number, Parameter: number) {
        super();
        this.Data = {
            id: DayId,
            t: Type,
            r: rank,
            p: Parameter
        };
    }
}