示例#1
0
        private void timer1_Tick(object sender, EventArgs e)
        {
            PackData pack = new PackData("8");

            pack.Start();
            sendpack(pack.result, pbdata.ip, pbdata.port);
            DataAnalysics dataAnalysics = new DataAnalysics();

            if (pbdata.roomPlayerNum[0] == 6 || pbdata.roomstate[0] == 1)
            {
                room1.Enabled = false;
            }

            /*if (pbdata.roomPlayerNum[1] == 6 || pbdata.roomstate[1] == 1)
             *  pictureBox1.Enabled = false;
             * if (pbdata.roomPlayerNum[2] == 6 || pbdata.roomstate[2] == 1)
             *  pictureBox1.Enabled = false;
             * if (pbdata.roomPlayerNum[3] == 6 || pbdata.roomstate[3] == 1)
             *  pictureBox1.Enabled = false;
             * if (pbdata.roomPlayerNum[4] == 6 || pbdata.roomstate[4] == 1)
             *  pictureBox1.Enabled = false;
             * if (pbdata.roomPlayerNum[5] == 6 || pbdata.roomstate[5] == 1)
             *  pictureBox1.Enabled = false;
             * if (pbdata.roomPlayerNum[6] == 6 || pbdata.roomstate[6] == 1)
             *  pictureBox1.Enabled = false;
             * if (pbdata.roomPlayerNum[7] == 6 || pbdata.roomstate[7] == 1)
             *  pictureBox1.Enabled = false;
             * if (pbdata.roomPlayerNum[8] == 6 || pbdata.roomstate[8] == 1)
             *  pictureBox1.Enabled = false;*/
            //Application.DoEvents();
        }
 /// <summary>
 /// 铅笔方法
 /// </summary>
 /// <param name="e">鼠标参数</param>
 public void DrawDot(MouseEventArgs e)
 {
     // int i = 0;
     //pbdata.location[i, 0] = startPointF.X;
     if (startDraw)
     {
         pbdata.location[i, 0] = (int)startPointF.X;
         pbdata.location[i, 1] = (int)startPointF.Y;
         newgraphics           = Graphics.FromImage(finishingImg);
         PointF currentPointF = new PointF(e.X, e.Y);
         newgraphics.DrawLine(p, startPointF, currentPointF);
         startPointF = currentPointF;
         newgraphics.Dispose();
         DrawTools_Graphics.DrawImage(finishingImg, 0, 0);
         i++;
         while (i == 10)
         {
             PackData pack = new PackData("4");
             pack.Roomnumber = pbdata.Roomnumber;
             pack.Name       = pbdata.Name;
             pack.Location   = pbdata.location;
             pack.Start();
             sendpack(pack.result, pbdata.ip, pbdata.port);
             //pbdata.location[9, 0] = (int)startPointF.X;
             //pbdata.location[9, 1] = (int)startPointF.Y;
             // startPointF.X = pbdata.location[9, 0];
             //startPointF.Y = pbdata.location[9, 1];
             pbdata.location = new int[10, 2];
             i = 0;
         }
     }
 }
示例#3
0
        //pbimg"鼠标松开"事件处理方法
        private void pbImg_MouseUp(object sender, MouseEventArgs e)
        {
            if (dt != null)
            {
                if (dt.i == 10)
                {
                    pbdata.location[0, 0] = 9999;
                    pbdata.location[0, 1] = 9999;
                }
                else
                {
                    pbdata.location[dt.i, 0] = 9999;
                    pbdata.location[dt.i, 1] = 9999;
                }
                dt.i = 0;
                PackData pack = new PackData("4");
                pack.Roomnumber = pbdata.Roomnumber;
                pack.Name       = pbdata.Name;
                pack.Location   = pbdata.location;
                pack.Start();
                sendpack(pack.result, pbdata.ip, pbdata.port);

                label1.Text = "松开鼠标";
                dt.EndDraw();
            }
        }
示例#4
0
        private void startgame_Click(object sender, EventArgs e)
        {
            PackData pack = new PackData("7");

            pack.Roomnumber = pbdata.Roomnumber;
            pack.Name       = pbdata.Name;
            pack.Start();
            sendpack(pack.result, pbdata.ip, pbdata.port);
        }
示例#5
0
        private void send_Click(object sender, EventArgs e)
        {
            PackData pack = new PackData("3");

            pack.Message    = messagebox.Text;
            pack.Name       = pbdata.Name;
            pack.Roomnumber = pbdata.Roomnumber;
            pack.Start();
            sendpack(pack.result, pbdata.ip, pbdata.port);
            messagebox.Text = "";
        }
示例#6
0
        private void room_FormClosed(object sender, FormClosedEventArgs e)
        {
            PackData pack = new PackData("2");

            pack.Name       = pbdata.Name;
            pack.Roomnumber = pbdata.Roomnumber;
            pack.Start();
            sendpack(pack.result, pbdata.ip, pbdata.port);

            this.Close();
            this.DialogResult = DialogResult.OK;

            /*allroom allroom = new allroom();
             * allroom.Show();*/
        }
示例#7
0
        private void room1_Click(object sender, EventArgs e)
        {
            PackData pack = new PackData("1");

            pack.Roomnumber = "1";
            pack.Name       = pbdata.Name;
            pack.Start();
            sendpack(pack.result, pbdata.ip, pbdata.port);

            pbdata.Roomnumber = "1";
            this.timer1.Stop();
            room room = new room();

            this.Hide();
            if (room.ShowDialog() == DialogResult.OK)
            {
                this.Show();
                this.timer1.Start();
            }
        }