这是我的链:
public abstract class Item ->
public abstract class MiscItem ->
public abstract class OtherItem ->
public class TransformableOther;
在Item
中,有一个复制构造函数:
public Item (Item other)
{
// copy stuff ...
}
我想这样做:
var trans = new TransformableOther (otherItem);
当然那没有用,我去TransformableOther
尝试了:
public TransformableOther(Item other): base (other) {}
但这并不奏效,当然这只是调用直接在上面的父级。我去了那里,OtherItem
做了同样的事情,所以对于它的父母MiscItem
来说,它没有用。
我怎样才能达到我想要的?- 如果我不能,这有什么技巧?
谢谢。
编辑:我的错,出于某种原因在我的代码中我正在做的base.Item(otherItem)
而不是base(otherItem)
我在问题中写的实际上是什么。