Witam. Czy ktoś mógłby mi łopatologicznie, jak debilowi, w najbardziej opisowy sposób wytłumaczyć jak działa konstruktor w tej strukturze?:
public struct Vector
{
private float x;
public float X
{
get { return x; }
set { x = value; }
}
private float y;
public float Y
{
get { return y; }
set { y = value; }
}
private float z;
public float Z
{
get { return z; }
set { z = value; }
}
public Vector(float x, float y, float z)
{
this.x = x;
this.y = y;
this.z = z;
}
public Vector(Vector p1, Vector p2)
{
this.x = p2.X - p1.X;
this.y = p2.Y - p1.Y;
this.z = p2.Z - p1.Z;
}
public Vector(Vector v)
{
this.x = v.X;
this.y = v.Y;
this.z = v.Z;
}
}