import * as SDKENUM from "../SDKConst/SDKEnum"; import * as SDKLogicsCore from "./SDKLogicsCore"; export default class SDKControllState { /**教学模式 */ protected _teachingMode: SDKENUM.TEACHING_MODE; /**控制者id */ protected _controllerId: string; constructor() { this.reset(); } public get controllerId():string{ return this._controllerId; } public set controllerId(value:string){ this._controllerId = value; } public set teachingMode(value:SDKENUM.TEACHING_MODE){ this._teachingMode = value; } public get teachingMode():SDKENUM.TEACHING_MODE{ return this._teachingMode; } /** * 自己是否是控制者 */ public isOwn():boolean{ //-1表示 所有的人都是控制者。。。都可以自由的玩游戏 if(!SDKLogicsCore.parameterVo.isGameClass()){ return false; } if(!SDKLogicsCore.parameterVo.isStudent() && !SDKLogicsCore.parameterVo.isTeacher()){ return false; } return this._controllerId == SDKLogicsCore.parameterVo.userId || this._controllerId == "-1"; } /** * 自己是否是完全控制着。。。只能有且只有自己一个人操作 */ public isFullOwn():boolean{ if(!SDKLogicsCore.parameterVo.isGameClass()){ return false; } if(!SDKLogicsCore.parameterVo.isStudent() && !SDKLogicsCore.parameterVo.isTeacher()){ return false; } return this._controllerId == SDKLogicsCore.parameterVo.userId; } public isObserverOwn(): boolean{ if(!SDKLogicsCore.parameterVo.isGameObserver()){ return false; } return this._controllerId == SDKLogicsCore.parameterVo.observerId || this._controllerId == "-1"; } public isOberverFullOwn(): boolean{ if(!SDKLogicsCore.parameterVo.isGameObserver()){ return false; } return this._controllerId == SDKLogicsCore.parameterVo.observerId; } public reset():void{ this._controllerId = ""; this._teachingMode = SDKENUM.TEACHING_MODE.TYPE_TEACHING; } }