public object Clone() { //Copierea Point newPoint = (Point)this.MemberwiseClone(); //Completarea PointDescription currentDesc = new PointDescription(); currentDesc.PetName = this.desc.PetName; newPoint.desc = currentDesc; return(newPoint); //sau in loc de toate astea //return new Point(X, Y, desc.PetName); }
public Point(int xPos, int yPos, string petName) { X = xPos; Y = yPos; desc = new PointDescription(); desc.PetName = petName; }