I have an interface which has a property with public get and protected set.
Yet when I implement this in my class i get an error saying it must be public.
My interface looks like this:
public interface ISegment
{
INode NodeA { get; protected set; }
INode NodeB { get; protected set; }
public sealed void SetNodeA(INode node) => NodeA = node;
public sealed void SetNodeB(INode node) => NodeB = node;
}
My class Segment : ISegment
has the properties declared like this:
[SerializeField]
protected Node _nodeA;
public INode NodeA
{
get => _nodeA;
protected set => _nodeA = value as Node;
}
[SerializeField]
protected Node _nodeB;
public INode NodeB
{
get => _nodeB;
protected set => _nodeB = value as Node;
}
And i get this error:
'Segment' does not implement interface member 'ISegment.NodeA.set'
'Segment' does not implement interface member 'ISegment.NodeB.set'
What am i misunderstanding here?