import SDKControllerBase from "./SDKControllerBase"; import SDKWebDashBoardView from "../SDKView/SDKWebDashBoardView"; import SDKPacket from "../SDKNetwork/SDKPacket"; import SDKPcDashBoardView from "../SDKView/SDKPcDashBoardView"; import * as SDKLogicsCore from "../SDKLogics/SDKLogicsCore"; import * as SDKENUM from "../SDKConst/SDKEnum"; export default class SDKWebDashBoradController extends SDKControllerBase { private _SDKWebDashBoardView: SDKWebDashBoardView; private _SDKPcDashBoardView: SDKPcDashBoardView; constructor() { super(); } protected constructorViews(): void { super.constructorViews(); console.log("角色视图......",SDKLogicsCore.parameterVo.isTeacher(),SDKLogicsCore.parameterVo.isOberverTeacher()); if (SDKLogicsCore.parameterVo.isTeacher() || SDKLogicsCore.parameterVo.isOberverTeacher()) { this._SDKWebDashBoardView = new SDKWebDashBoardView(this); this._views.push(this._SDKWebDashBoardView); } else if (!SDKLogicsCore.parameterVo.isGameClass() && !SDKLogicsCore.parameterVo.isSplitScreen()) { this._SDKPcDashBoardView = new SDKPcDashBoardView(this); this._views.push(this._SDKPcDashBoardView); } } /** * 更新权限 * @param controllerId 权限id */ public setController(controllerId: string): void { if (!this._SDKWebDashBoardView) { return; } this._SDKWebDashBoardView.setController(controllerId); } /** * 向子iframe派发消息 * @param packet */ public dispatcherSubIframe(packet: SDKPacket) { if (!this._SDKWebDashBoardView) { return; } this._SDKWebDashBoardView.dispatcherSubIframe(packet); } /** * 子iframe通知初始化准备好了 * @param userId 学生id */ public splitGameReady(userId: string): void { if (!this._SDKWebDashBoardView) { return; } this._SDKWebDashBoardView.splitGameReady(userId); } /** * 用户信息更新 */ public updateUsers(): void { if (!this._SDKWebDashBoardView) { return; } this._SDKWebDashBoardView.updateUsers(); } /** * 显示或者隐藏老师切换控制权限 */ public displayControll(isShow: boolean): void { if (!this._SDKWebDashBoardView) { return; } this._SDKWebDashBoardView.displayControll(isShow); } public teachModleChange(teacherModle: SDKENUM.TEACHING_MODE) { if (!this._SDKWebDashBoardView) { return; } this._SDKWebDashBoardView.teachModleChange(teacherModle); } public reset(): void { super.reset(); } public destroy(): void { super.destroy(); } }