Esempio n. 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);
        }
Esempio n. 2
0
        public bool GameRoomIsWorking; //游戏大厅桌子是否已经开始玩



        public MainLogic()
        {
            myClientSoc = new MyClientSoc();
            keepalive   = false;
            //初始化数据
            // 生成界面的form
            hall              = new Room(this);
            gameRoom          = CreateGameForm();
            GameRoomIsWorking = false;


            myStatus = PlayerStatus.OffLine;
            msgList  = new List <Message>();
            thisLock = new Object();

            hall.btnClickEvent += ExitHall;
            this.tableIdx       = -1;
            this.seatIdx        = -1;
        }