Beispiel #1
0
        private CSharpGame CreateGameForm()
        {
            CSharpGame gameForm = new CSharpGame(this);

            // 首先创建4个logic
            myLogic = new Logic(1);
            myLogic.sendMsgEvent += SendGameData;

            otherPlayersLogic = new List <Logic>();
            for (int i = 0; i < 3; i++)
            {
                otherPlayersLogic.Add(new Logic(2));
            }

            // 将Logic的界面显示到gameForm中
            GameArea ga = myLogic.gameArea;

            gameForm.CreateMainArea(ga);
            // 游戏开始前隐藏btn
            ga.UnGameStatus();
            List <GameArea> ret = new List <GameArea>();

            foreach (Logic lg in otherPlayersLogic)
            {
                ret.Add(lg.gameArea);
                lg.gameArea.Hide();
            }
            gameForm.CreateOppeArea(ret);
            foreach (Logic lg in otherPlayersLogic)
            {
                lg.gameArea.UnGameStatus();
            }

            return(gameForm);
        }
Beispiel #2
0
        // public delegate void showFun(bool b);
        //显示游戏界面中其他玩家界面
        private void showGameRoom(int tableIdx, int seatIdx)
        {
            myLogic.gameArea.UnGameStatus();
            gameTable tablesInfo = hall.tables[tableIdx];
            int       mypos      = seatIdx;
            int       t          = 0;

            for (int i = mypos + 1; i < mypos + 4; i++)
            {
                int k = i % 4;
                if (tablesInfo.seatUser[k] != "")
                {
                    otherPlayersLogic[t].SetPlayer(tablesInfo.seatUser[k]);
                    GameArea ga = otherPlayersLogic[t].gameArea;
                    ga.UnGameStatus();
                    ga.Show();
                }
                else
                {
                    GameArea ga = otherPlayersLogic[t].gameArea;
                    ga.UnGameStatus();
                    //ga.Show();
                }
                t++;
            }
        }