Orvel
Orvel

Reputation: 297

enum property inconsistent accessibility

I am new at CSharp, and do not understand what is the problem.

public abstract class Player
{
protected Behaviour fBehaviour;
public Behaviour FBehaviour { get; set; }

the error says Error 6 Inconsistent accessibility: field type ... is less accessible than field ...

I've tried changing everything, but nothing worked.

Upvotes: 3

Views: 5734

Answers (1)

Axarydax
Axarydax

Reputation: 16603

It means that class Behavior is not public, but Player is and is trying to expose it as public.

Change Behavior to be public.

Upvotes: 10

Related Questions