public object accept(foodvisitor v) // only accepts master visitor methods { if (v is mastervisitor) return ((mastervisitor)v).visit(this); else throw new Exception("this visitor will not work"); }
// only accepts master visitor methods public object accept(foodvisitor v) { if (v is mastervisitor) return ((mastervisitor)v).visit(this); else throw new Exception("this visitor will not work"); }
public object accept(foodvisitor v) { return(v.visit(this)); }