/// <summary> /// 坐骑坐乘,更换通讯读取处理 /// </summary> private void doPutonMounts(ErlArray erlArray, int index) { string msgInfo = erlArray.Value [index++].getValueString(); if (msgInfo == "ok") { string uid = erlArray.Value [index++].getValueString(); MountsManagerment manager = MountsManagerment.Instance; Mounts useMounts = manager.getMountsInUse(); if (useMounts != null) { useMounts.setState(false); } Mounts mounts = manager.getMountsByUid(uid); if (mounts != null) { mounts.setState(true); } } else { UiManager.Instance.openDialogWindow <MessageWindow> ((win) => { win.initWindow(1, LanguageConfigManager.Instance.getLanguage("s0093"), null, msgInfo, null); }); } if (callback != null) { callback(); callback = null; } }
/** 处理休息事件 */ private void HandleUnsnatchNEvent(GameObject gameObj) { // 与服务器通讯 (FPortManager.Instance.getFPort("MountsRideFPort") as MountsRideFPort).putOffMountsAccess(() => { init(fatherWindow); }); Mounts temp = MountsManagerment.Instance.getMountsInUse(); if (temp != null) { temp.setState(false); } init(fatherWindow); }
/// <summary> /// 改变出战状态 /// </summary> /// <param name="mounts">如果为空,则不管传什么,都全部设为不出战</param> /// <param name="isUse">如果设置 <c>true</c> 出战.</param> public void chagneUseType(Mounts mounts, bool isUse) { List <Mounts> allList = getAllMountsList(); if (mounts == null) { if (allList.Count == 0) { return; } else { for (int i = 0; i < allList.Count; i++) { if (allList[i].isInUse()) { allList[i].setState(false); } } } } else { if (isUse) { for (int i = 0; i < allList.Count; i++) { if (allList[i].isInUse()) { allList[i].setState(false); } } } mounts.setState(isUse); } }