Ejemplo n.º 1
0
 public void InitPanel()
 {
     EventMsgMgr.RegisterEvent(CommEventID.FrienCircleCutShowWanFa, FrienCircleCutShowWanFaEvent);
     _FiveStarRoomConfig = FiveStarRoomConfigFactory.Create(mData.RoomConfigLists);
     InitRoomItemInfo();
     mJoinBtn.Add(JoinRoom);
 }
Ejemplo n.º 2
0
        public void AlterWanfaFinshCall(RepeatedField <int> configs)
        {
            _CurrSelectWanFaConfigs = configs;
            FiveStarRoomConfig fiveStarRoomConfig = FiveStarRoomConfigFactory.Create(_CurrSelectWanFaConfigs);

            mWanFaText.text = fiveStarRoomConfig.GetWanFaDesc(false);
            fiveStarRoomConfig.Dispose();
        }
Ejemplo n.º 3
0
        public FiveStarRoomConfig defaultWanFaConfigInfo;//当前亲友默认玩法配置

        public FiveStarRoomConfig GetDefaultWanFaConfigInfoasd()
        {
            if (defaultWanFaConfigInfo == null || defaultWanFaConfigInfo.Configs == null)
            {
                defaultWanFaConfigInfo = FiveStarRoomConfigFactory.Create(DefaultWanFaCofigs);
            }
            return(defaultWanFaConfigInfo);
        }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
        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;
            }
        }
Ejemplo n.º 6
0
        //录像房间信息初始化
        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;
            }
        }
Ejemplo n.º 7
0
 //设置房间配置信息
 public void SetConfigInfo(RepeatedField <int> configs)
 {
     _config = FiveStarRoomConfigFactory.Create(configs);
 }