mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-06-26 11:24:46 +00:00
42 lines
1.1 KiB
TypeScript
42 lines
1.1 KiB
TypeScript
import { app } from "../App";
|
|
import GBattleModeManager, { BattleMode } from "../battle/GBattleModeManager";
|
|
import { GAction } from "../consts/GAction";
|
|
import { GActionType } from "../consts/GActionType";
|
|
import { GUI } from "../ui/UIConfig";
|
|
import BaseAction from "./BaseAction";
|
|
|
|
export interface GPVPStart{
|
|
leftTactical:string;
|
|
rightTactical:string;
|
|
}
|
|
|
|
export default class PVPAction extends BaseAction {
|
|
|
|
onInit(){
|
|
app.socket.on(GAction.C_MODE_PVP_START_WAIT,this.onModePVPStartWait,this);
|
|
app.socket.on(GAction.C_MODE_PVP_END_WAIT,this.onModePVPEndWait,this);
|
|
app.socket.on(GAction.C_MODE_PVP_START,this.onModePVPStart,this,GActionType.GPVPStart);
|
|
}
|
|
|
|
//PVP开始等待
|
|
onModePVPStartWait(){
|
|
//PVP 匹配页面
|
|
app.layer.Open(GUI.PVPModeMatchView);
|
|
}
|
|
|
|
//PVP结束等待
|
|
onModePVPEndWait(){
|
|
//PVP 匹配页面
|
|
app.layer.Close(GUI.PVPModeMatchView);
|
|
}
|
|
|
|
//开始PVP
|
|
onModePVPStart(info:GPVPStart){
|
|
console.log("开始PVP",info);
|
|
GBattleModeManager.getIns().Open(BattleMode.PVP,true);
|
|
}
|
|
|
|
}
|
|
|
|
|