Exemple #1
0
        private IEnumerator GameTestLogic()
        {
            DataCenter.Instance.gamedata.CurDownTime = 3;
            ViewCenter.Instance.GetPanel <Panel_Main>(PanelType.Main).SetLabelTime(DataCenter.Instance.gamedata.CurDownTime);
            DataCenter.Instance.players[playerId].MoPai((MJType)(RandomMgr.Range((int)MJType.万_1, (int)MJType.MJ_白板)));
            ControlCenter.Instance.ReflushPlayerPanel(playerId);

            while (true)
            {
                if (mGameState == GAME_STATE.MAIN)
                {
                    yield return(new WaitForSeconds(1.0f));

                    DataCenter.Instance.gamedata.CurDownTime--;
                    ViewCenter.Instance.GetPanel <Panel_Main>(PanelType.Main).SetLabelTime(DataCenter.Instance.gamedata.CurDownTime);
                    if (DataCenter.Instance.gamedata.CurDownTime == 0)
                    {
                        ControlCenter.Instance.ChuPai(playerId, DataCenter.Instance.players[playerId].MJ_IN_List[0]);

                        yield return(new WaitForSeconds(1.0f));

                        GoToNextPlayer();
                    }
                    ViewCenter.Instance.GetPanel <Panel_Main>(PanelType.Main).SetLabelTime(DataCenter.Instance.gamedata.CurDownTime);
                }
                else
                {
                    yield return(null);
                }
            }
        }
Exemple #2
0
        public void GoToNextPlayer()
        {
            DataCenter.Instance.gamedata.CurDownTime = 3;
            playerId++;
            if (playerId > 3)
            {
                playerId = 0;
            }
            //摸牌
            DataCenter.Instance.players[playerId].MoPai((MJType)(RandomMgr.Range((int)MJType.万_1, (int)MJType.MJ_白板)));

            ControlCenter.Instance.ReflushPlayerPanel(playerId);
        }
Exemple #3
0
 public GameData()
 {
     IsHaveLogin           = false;
     CurDownTime           = 0;
     CurChuPaiDir          = DNXB_DIR.Null;
     SurplusMJSum          = 0;
     CurChuMJ              = null;
     gameMode              = GAME_MODE.创建房间;
     FangZhuDNXBDir        = DNXB_DIR.Null;
     playerInfo.MachineNum = 10001;
     playerInfo.Password   = "******";
     playerInfo.WXID       = "duang" + RandomMgr.Range(0, 100000);
     AdministratorName     = "XXX.bt";
     GameArea              = AREA_ENUM.桂林;
 }
Exemple #4
0
        private PlayerData GetNewPlayerData(int playerId)
        {
            PlayerData data = new PlayerData(playerId);

            for (int i = 0; i < 1; i++)
            {
                CPG_Struct cs = new CPG_Struct();
                cs.type = CPG_TYPE.碰;
                cs.Init(CPG_TYPE.碰, new List <MJType>()
                {
                    MJType.条_1 + playerId, MJType.条_1 + playerId, MJType.条_1 + playerId
                }, SEAT_DIR.DIR_RIGHT);
                data.MJ_CPG_List.Add(cs);

                cs      = new CPG_Struct();
                cs.type = CPG_TYPE.杠;
                cs.Init(CPG_TYPE.杠, new List <MJType>()
                {
                    MJType.条_5, MJType.条_5, MJType.条_5, MJType.条_5
                }, SEAT_DIR.DIR_RIGHT);
                data.MJ_CPG_List.Add(cs);

                cs      = new CPG_Struct();
                cs.type = CPG_TYPE.暗杠;
                cs.Init(CPG_TYPE.暗杠, new List <MJType>()
                {
                    MJType.条_6, MJType.条_6, MJType.条_6, MJType.条_6
                }, SEAT_DIR.DIR_RIGHT);
                data.MJ_CPG_List.Add(cs);
            }
            for (int i = 0; i < 8; i++)
            {
                data.MJ_OUT_List.Add((MJType)(RandomMgr.Range((int)MJType.万_1, (int)MJType.MJ_白板)));
            }
            for (int i = 0; i < 7; i++)
            {
                data.MJ_IN_List.Add((MJType)(RandomMgr.Range((int)MJType.万_1, (int)MJType.MJ_白板)));
            }

            return(data);
        }