Problems making struct.

I have the following struct

namespace CloneFrenzy { public struct Circle { public Vector2 Center { get; set; } public float Radius { get; set; } public Circle (Vector2 center, float radius) { Center = center; Radius = radius; } public bool Contains (Vector2 point) { return ((point - Center).Length() <= Radius); } public bool Intersects (Circle other) { return ((other.Center - Center).Length() < (other.Radius - Radius)); } } } 

However there are 2 errors on it. on the line

public Circle(Vector 2 ect...) 

The word Circle is underlined and the error is: Error 2 Backing field for automatically implemented property 'CloneFrenzy.Circle.Center' must be fully assigned before control is returned to the caller.

And in the line:

Center = center; 

I have the same error. What is going on?

by vroomvsr via /r/csharp

Leave a Reply