public object visit(fruit f) { if (f.Calories < min.Calories) { min = f; } return(f.nextitem.accept(this)); }
public object visit(fruit f) { if (state != "fruit") { return(false); } else { return(f.nextitem.accept(this)); } }
public object visit(fruit f) { Console.WriteLine("I'm eating the fruit " + f); cals += f.Calories; if (cals < max) { return(f.nextitem.accept(this)); } else { return(cals); } }
public object visit(fruit f) { foodSum += f.Calories; return(f.nextitem.accept(this)); }