Exemplo n.º 1
0
        public Board(Lobby the_lobby, string str)
        {
            lobby = the_lobby;
            pictureBox1.Location  = ChessBoard.Location;
            pictureBox1.Height    = ChessBoard.Height;
            pictureBox1.Width     = ChessBoard.Width;
            pictureBox1.BackColor = Color.Transparent;
            InitializeComponent();
            for (int i = 0; i < 10; i++)
            {
                checkerboard[i] = new Chess[9];//10行9列
            }
            for (int i = 0; i < 10; i++)
            {
                for (int j = 0; j < 9; j++)
                {
                    checkerboard[i][j] = new Chess_blank();
                }
            }
            checkerboard[0][0] = new Chess_che(enemy);
            checkerboard[0][1] = new Chess_ma(enemy);
            checkerboard[0][2] = new Chess_xiang(enemy);
            checkerboard[0][3] = new Chess_shi(enemy);
            checkerboard[0][4] = new Chess_jiang(enemy);
            checkerboard[0][5] = new Chess_shi(enemy);
            checkerboard[0][6] = new Chess_xiang(enemy);
            checkerboard[0][7] = new Chess_ma(enemy);
            checkerboard[0][8] = new Chess_che(enemy);
            checkerboard[2][1] = new Chess_pao(enemy);
            checkerboard[2][7] = new Chess_pao(enemy);
            checkerboard[3][0] = new Chess_zu(enemy);
            checkerboard[3][2] = new Chess_zu(enemy);
            checkerboard[3][4] = new Chess_zu(enemy);
            checkerboard[3][6] = new Chess_zu(enemy);
            checkerboard[3][8] = new Chess_zu(enemy);


            checkerboard[6][0] = new Chess_zu(me);
            checkerboard[6][2] = new Chess_zu(me);
            checkerboard[6][4] = new Chess_zu(me);
            checkerboard[6][6] = new Chess_zu(me);
            checkerboard[6][8] = new Chess_zu(me);
            checkerboard[7][1] = new Chess_pao(me);
            checkerboard[7][7] = new Chess_pao(me);
            checkerboard[9][0] = new Chess_che(me);
            checkerboard[9][1] = new Chess_ma(me);
            checkerboard[9][2] = new Chess_xiang(me);
            checkerboard[9][3] = new Chess_shi(me);
            checkerboard[9][4] = new Chess_jiang(me);
            checkerboard[9][5] = new Chess_shi(me);
            checkerboard[9][6] = new Chess_xiang(me);
            checkerboard[9][7] = new Chess_ma(me);
            checkerboard[9][8] = new Chess_che(me);
            Clearground(this, ref checkerboard);

            for (int i = 0; i != 9; ++i)
            {
                for (int j = 0; j != 10; ++j)
                {
                    ChessBoard.Controls.Add(checkerboard[j][i].PB);
                }
            }
            if (str.Equals("0"))
            {
                me    = player_type.blue;
                enemy = player_type.red;
            }
            else
            {
                me    = player_type.red;
                enemy = player_type.blue;
            }
        }
Exemplo n.º 2
0
 public NewRoom(Lobby the_lobby)
 {
     lobby = the_lobby;
     InitializeComponent();
 }
Exemplo n.º 3
0
 public Joinin(Lobby the_lobby)
 {
     lobby = the_lobby;
     InitializeComponent();
 }