public void InitPanel() { EventMsgMgr.RegisterEvent(CommEventID.FrienCircleCutShowWanFa, FrienCircleCutShowWanFaEvent); _FiveStarRoomConfig = FiveStarRoomConfigFactory.Create(mData.RoomConfigLists); InitRoomItemInfo(); mJoinBtn.Add(JoinRoom); }
public void AlterWanfaFinshCall(RepeatedField <int> configs) { _CurrSelectWanFaConfigs = configs; FiveStarRoomConfig fiveStarRoomConfig = FiveStarRoomConfigFactory.Create(_CurrSelectWanFaConfigs); mWanFaText.text = fiveStarRoomConfig.GetWanFaDesc(false); fiveStarRoomConfig.Dispose(); }
public FiveStarRoomConfig defaultWanFaConfigInfo;//当前亲友默认玩法配置 public FiveStarRoomConfig GetDefaultWanFaConfigInfoasd() { if (defaultWanFaConfigInfo == null || defaultWanFaConfigInfo.Configs == null) { defaultWanFaConfigInfo = FiveStarRoomConfigFactory.Create(DefaultWanFaCofigs); } return(defaultWanFaConfigInfo); }
//分享房间 public static void RoomShare(int roomId, FiveStarRoomConfig config, int existingNumber) { string url = HomeUrl + "?roomId=" + roomId; string title = $"{ShareTitle} 房号-{roomId},已有({existingNumber}/{config.RoomNumber})人"; string desc = config.GetWanFaDesc(true, roomId); SdkMgr.Ins.WeChatShareUrl(url, title, desc, WxShareSceneType.Friend); }
public override void Dispose() { Ins = null; LittleRoundClearData(); //每小局要清空的数据 _FriendsCircleId = 0; //对应亲友圈id _CuurRoomOffice = 0; //当前房间的局数 _RoomType = RoomType.Match; //房间类型默认是匹配 _RoomState = RoomStateType.None; //房间现在的状态 _config = null; //房间配置信息 _userServereatIndex = -1; //用户所在牌局的服务器索引 _ServerSeatIndexInPlayer.Clear(); //清空玩家对象 base.Dispose(); }
public static void Video_GameInitDispose(List <object> objects, Video_GameInit gameInit) { objects.Add(gameInit); Video_Deal deal = new Video_Deal(); Video_PiaoFen piaofen = new Video_PiaoFen(); for (int j = 0; j < gameInit.PlayerInfos.Count; j++) { deal.AllHands.Add(gameInit.PlayerInfos[j].Hands); piaofen.PiaoFens.Add(gameInit.PlayerInfos[j].PiaoFen); } FiveStarRoomConfig foveConfig = FiveStarRoomConfigFactory.Create(gameInit.RoomConfigs); if (foveConfig.MaxPiaoNum > 0) { objects.Add(piaofen); } objects.Add(deal); }
public static async Task <FiveStarRoom> Create(M2S_StartGame m2SStartGame) { try { FiveStarRoom fiveStarRoom = ComponentFactory.Create <FiveStarRoom>(); FiveStarRoomConfig fiveStarRoomConfig = FiveStarRoomConfigFactory.Create(m2SStartGame.RoomConfig.RoomConfigs);//创建房间配置信息 fiveStarRoom.FriendsCircleId = m2SStartGame.FriendsCircleId; fiveStarRoom.NeedJeweNumCount = m2SStartGame.NeedJeweNumCount; //需要的钻石数量 fiveStarRoom.RoomConfig = fiveStarRoomConfig; //房间配置 fiveStarRoom.MathRoomId = m2SStartGame.RoomConfig.MatchRoomId; //匹配房间ID 在房卡模式下就是本身的房间ID fiveStarRoom.RoomId = m2SStartGame.RoomId; //房间ID fiveStarRoom.RoomType = m2SStartGame.RoomType; //赋值房间类型 fiveStarRoom.RoomNumber = fiveStarRoomConfig.RoomNumber; //房间人数 fiveStarRoom.CurrRoomStateType = RoomStateType.GameIn; //房间状态 改为游戏中 if (fiveStarRoom.RoomType == RoomType.RoomCard) { fiveStarRoom.StartVideoDataId = FiveStarRoomComponent.Ins.GetMiltaryDataStartId(); //如果在房卡模式要获取起始录像Id } fiveStarRoom.IsHaveAI = false; //默认是没有AI的 //创建玩家对象 foreach (var playerInfo in m2SStartGame.MatchPlayerInfos) { fiveStarRoom.FiveStarPlayerDic[playerInfo.SeatIndex] = await FiveStarPlayerFactory.Create(playerInfo, fiveStarRoom); if (playerInfo.IsAI) { fiveStarRoom.IsHaveAI = true;//只要有一个AI就是有AI } } await fiveStarRoom.AddComponent <MailBoxComponent>().AddLocation(); return(fiveStarRoom); } catch (Exception e) { Log.Error(e); throw; } }
//录像房间信息初始化 private void GameInit(Video_GameInit gameInit) { if (_PlayerDic.Count > 0) { return; } //初始化房间信息 _RoomConfig = FiveStarRoomConfigFactory.Create(gameInit.RoomConfigs); string roomInfo = "房号:" + gameInit.RoomNumber + " " + gameInit.OfficeNumber + "/" + _RoomConfig.MaxJuShu + "局 " + _RoomConfig.RoomNumber + "人局"; _CurrRoomOffice = gameInit.OfficeNumber; _roomPanel.SetRoomInfo(roomInfo); //先隐藏所有玩家头像 EventMsgMgr.SendEvent(CardFiveStarEventID.HideAllPlayer); //先记录出当前位置的服务器 int selfSelfIndex = 0; for (int i = 0; i < gameInit.PlayerInfos.Count; i++) { if (gameInit.PlayerInfos[i].UserId == UserComponent.Ins.pUserId) { selfSelfIndex = i; break; } } //创建玩家头像信息 for (int i = 0; i < gameInit.PlayerInfos.Count; i++) { User user = new User(); user.Name = gameInit.PlayerInfos[i].Name; user.Icon = gameInit.PlayerInfos[i].Icon; user.UserId = gameInit.PlayerInfos[i].UserId; user.IsOnLine = true; CardFiveStarPlayer player = CardFiveStarPlayerFactory.Creator(user, i, selfSelfIndex, _RoomConfig.RoomNumber, _roomPanel.mPlayerUIsGo.transform, gameInit.PlayerInfos[i].NowScore);//创建用户 _PlayerDic[gameInit.PlayerInfos[i].SeatIndex] = player; } }
public static FiveStarRoomConfig Create(RepeatedField <int> roomConfigs) { FiveStarRoomConfig fiveStarRoom = ComponentFactory.Create <FiveStarRoomConfig>(); if (roomConfigs.Count != CardFiveStarRoomConfig.ConfigCount) { Log.Error("房间配置的条数不一致" + roomConfigs.Count); return(null); } fiveStarRoom.Configs = roomConfigs; fiveStarRoom.EndType = roomConfigs[CardFiveStarRoomConfig.EndTypeId]; fiveStarRoom.MaxJuShu = roomConfigs[CardFiveStarRoomConfig.JuShuId]; fiveStarRoom.TuoDiFen = roomConfigs[CardFiveStarRoomConfig.FenTuoDiId]; fiveStarRoom.PayMoneyType = roomConfigs[CardFiveStarRoomConfig.PayMoneyId]; fiveStarRoom.RoomNumber = roomConfigs[CardFiveStarRoomConfig.NumberId]; fiveStarRoom.BottomScore = roomConfigs[CardFiveStarRoomConfig.BottomScoreId]; fiveStarRoom.MaxPiaoNum = roomConfigs[CardFiveStarRoomConfig.FloatNumId]; fiveStarRoom.MaiMaType = roomConfigs[CardFiveStarRoomConfig.MaiMaId]; fiveStarRoom.WaiShiWuType = roomConfigs[CardFiveStarRoomConfig.WaiShiWuId]; fiveStarRoom.FengDingFanShu = roomConfigs[CardFiveStarRoomConfig.FengDingFanShuId]; fiveStarRoom.IsHaveOverTime = roomConfigs[CardFiveStarRoomConfig.IsHaveOverTimeId] != 0; return(fiveStarRoom); }
//设置房间配置信息 public void SetConfigInfo(RepeatedField <int> configs) { _config = FiveStarRoomConfigFactory.Create(configs); }