import { Application, ChannelService } from 'pinus';
import { resetPvpSeasonTime, setPvpDefResult, guildActivityStart, gateActivityEnd, cityActivityEnd, raceActivityEnd } from '../../../services/timeTaskService';
import PvpDefenseType from '../../../db/PvpDefense';
import { DicGuildActivity } from '../../../pubUtils/dictionary/DicGuildActivity';
import { reloadResources } from '../../../pubUtils/data';
export default function (app: Application) {
    return new SystimerRemote(app);
}

export class SystimerRemote {

    constructor(private app: Application) {
        this.app = app;
        this.channelService = app.get('channelService');
    }
    private channelService: ChannelService;

    public async resetPvpSeasonTime(day: number) {
        return await resetPvpSeasonTime(day);
    }

    public async setPvpDefResult(pvpDefense: PvpDefenseType, seasonNum: number, seasonEndTime:number) {
        return await setPvpDefResult(pvpDefense, seasonNum, seasonEndTime);
    }

    public async guildActivityStart(dicGuildActivity: DicGuildActivity) {
        return await guildActivityStart(dicGuildActivity);
    }

    public async gateActivityEnd() {
        return await gateActivityEnd();
    }

    public async cityActivityEnd() {
        return await cityActivityEnd();
    }

    public async raceActivityEnd() {
        return await raceActivityEnd();
    }
        
    /**
     * 重载json资源
     */
    public async reloadResources() {
        reloadResources();
    }
}
