-1

我可以在字段中添加点,但我不能删除它们。这是我目前使用的代码:

public class Vertex
{
    public Point p { get; private set; }
    public int ident {get; private set; }
    public int dist { get; set; }

    public Vertex(Point p, int ident)
    {
        this.p = p;
        this.ident = ident;
    }
}
4

2 回答 2

0

您也许可以使用:

this.p = Point.Empty;
this.indent = 0;

因此,像这样调用您的方法 Vertex :

Vertex(Point.Empty, 0);
于 2013-02-25T21:16:25.743 回答
-1

您可以设置重置方法p

public class Vertex
{
        public Point p { get; private set; }
        public int ident {get; private set; }
        public int dist { get; set; }

        public Vertex(Point p, int ident)
        {
            this.p = p;
            this.ident = ident;
        }

        public void Reset() { p = new Point(); }
}
于 2013-02-25T21:18:26.893 回答