考虑代码:
public abstract class Base
{
public Dictionary<int, string> Entities { get; private set; }
protected Base()
{
Entities = new Dictionary<int, string>();
}
}
public abstract class A : Base
{
public abstract void Update();
}
public abstract class B : Base
{
public abstract void Draw();
}
是否可以限制类(在同一个程序集中)从继承自Base
,强制它们继承自A
或B
?