示例#1
0
 // 共用的訪問者界面
 public void RunVisitor(IShapeVisitor theVisitor)
 {
     foreach (IShape theShape in m_Shapes)
     {
         theShape.RunVisitor(theVisitor);
     }
 }
示例#2
0
 public override void RunVisitor(IShapeVisitor theVisitor)
 {
     theVisitor.VisitCube(this);
 }
示例#3
0
 public override void RunVisitor(IShapeVisitor theVisitor)
 {
     theVisitor.VisitCylinder(this);
 }
示例#4
0
 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);