示例#1
0
        public void NewClientGame()
        {
            gametype = GameType.ClientGame;

            this.player1 = new Player("", Side.White);
            this.player2 = CreateUser(view.GetUserName(Side.Black), Side.Black, player2);
            //this.player1 = new Player("", Side.White);
            //this.player2 = new Player("", Side.Black);

            state = GameState.WaitWhite;
            Field = new ChessField(player1, player2);
            field.SetPawnSuperiousListener(PawnSuperiorityHandler);
            field.SetKingShahListener(KingShahHandler);
            field.SetKingStalemateListener(KingStalemateHandler);
            view.ClearLog();
            client = new ClientThread(view, this, view.GetServerAddress(), 12000);
            Thread thread = new Thread(client.Run);

            thread.Start();
            thread.IsBackground = true;
            //thread.Join();
        }
示例#2
0
文件: Game.cs 项目: peleccom/chess
        public void NewClientGame()
        {
            gametype = GameType.ClientGame;

            this.player1 = new Player("", Side.White);
            this.player2 = CreateUser(view.GetUserName(Side.Black), Side.Black, player2);
            //this.player1 = new Player("", Side.White);
            //this.player2 = new Player("", Side.Black);

            state = GameState.WaitWhite;
            Field = new ChessField(player1, player2);
            field.SetPawnSuperiousListener(PawnSuperiorityHandler);
            field.SetKingShahListener(KingShahHandler);
            field.SetKingStalemateListener(KingStalemateHandler);
            view.ClearLog();
            client = new ClientThread(view, this, view.GetServerAddress(), 12000);
            Thread thread = new Thread(client.Run);
            thread.Start();
            thread.IsBackground = true;
            //thread.Join();
        }