C#窗体中我自定义类中的数据为什么传不到form里

Chess类里的pointlist中的点为什么传不到form类里的paint函数中,画不出来图形啊?有谁可以解答下吗

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace C_例_69_五子棋_窗体应用
{
public enum ChessState
{
BLANK,
BLACK,
WHITE
}

public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();
    }

    public int start = 0;
    public const int forever = 10;
    public bool fupan = false;
    public int count = forever;

    private void Form1_Paint(object sender, PaintEventArgs e)
    {
        Chess c1 = new Chess();

        Graphics g = e.Graphics;
        SolidBrush w = new SolidBrush(Color.White);
        SolidBrush b = new SolidBrush(Color.Black);

        for (int i = 0; i < c1.pointlist.Count; i++)
        {
            if (i % 2 == 0)
            {
                g.FillEllipse(w, x - 15, y - 15, 28, 28);
              
            if (i % 2 == 1)
            {
                g.FillEllipse(b, x - 15, y - 15, 28, 28);
                
            }
        }
    }

    private void Form1_MouseDown(object sender, MouseEventArgs e)
    {
        Chess c2 = new Chess();
        if (start == 1)
        {
            if (e.Location.X > 55 && e.Location.X < 505 && e.Location.Y > 65 && e.Location.Y < 515)
            {
                Point p1 = new Point();
                p1.X = e.Location.X; p1.Y = e.Location.Y;
                c2.pointlist.Add(p1);
                Invalidate();
            }
        }
       
    }

    private void rrstart_Click(object sender, EventArgs e)
    {
        Chess c = new Chess();
        c.pointlist.Clear();
        Invalidate();
        start = 1;
    }

  }

public struct Point
{
public int X;
public int Y;
}
class Chess
{
public int width = 640;
public int height = 600;

    public ChessState[,] qipan = new ChessState[15, 15];
    public List<Point> pointlist = new List<Point>(500);

  
}

}

Form1再定义一个传参的构造函数,通过构造函数传参进去就可以了。

Chess c1 = new Chess();
Chess c2 = new Chess();
Chess c = new Chess();

c1,c2,c是三个独立的对象,数据不共享,改变一个不会改变另一个。
定义一个Form1 中的全局变量,给其他函数调用

您好,我是有问必答小助手,您的问题已经有小伙伴帮您解答,感谢您对有问必答的支持与关注!
PS:问答VIP年卡 【限时加赠:IT技术图书免费领】,了解详情>>> https://vip.csdn.net/askvip?utm_source=1146287632