C#C
C#3y ago
Makian

Interfaces

Having issues with properly implementing interface property
public interface Item {
    public int durability { get; protected set; }
    public int maxDurability { get; protected set; }
}

public class Magazine : Item {
    public int durability { get => 1; protected set { } }
    public int maxDurability { get => 1; protected set { } }
}

Errors:
'Magazine' does not implement interface member 'Item.durability.set'. 'Magazine.durability.set' is not public
'Magazine' does not implement interface member 'Item.maxDurability.set'. 'Magazine.maxDurability.set' is not public
Was this page helpful?