// 共用的訪問者界面 public void RunVisitor(IShapeVisitor theVisitor) { foreach (IShape theShape in m_Shapes) { theShape.RunVisitor(theVisitor); } }
public override void RunVisitor(IShapeVisitor theVisitor) { theVisitor.VisitCube(this); }
public override void RunVisitor(IShapeVisitor theVisitor) { theVisitor.VisitCylinder(this); }
public abstract int GetVectorCount(); // 取得頂點數 public abstract void RunVisitor(IShapeVisitor theVisitor);
// 共用的訪問者界面 public void RunVisitor(IShapeVisitor theVisitor) { foreach(IShape theShape in m_Shapes) theShape.RunVisitor( theVisitor ); }
public override void RunVisitor(IShapeVisitor theVisitor) { theVisitor.VisitCylinder(this); }
public override void RunVisitor(IShapeVisitor theVisitor) { theVisitor.VisitCube(this); }
public abstract int GetVectorCount(); // 取得頂點數 public abstract void RunVisitor(IShapeVisitor theVisitor);