例子:
public class BoundingBox
{
public Vector3Double Positon { get; set; }
public Vector3Double Apothem { get; set; }
public ExtremasForX X;
public BoundingBox(Vector3Double position, Vector3Double size)
{
Positon = position;
X = new ExtremasForX(this);
}
private class ExtremasForX
{
private BoundingBox box;
public ExtremasForX(BoundingBox box)
{
this.box = box;
}
public double Max
{
get { return box.Positon.X + box.Apothem.X ; }
}
public double Min
{
get { return box.Positon.X - box.Apothem.X; }
}
}
}
此代码产生可访问性错误:BoundingBox.X 的级别高于其类型。
我想要一个没有公共构造函数的内部类,因为我只想将该类用作外部类的命名空间。我该怎么做?