public void Using() { var monkey = new Monkey(); var lion = new Lion(); var dolphin = new Dolphin(); var visitor = new AnimalVisitor(); monkey.Accept(visitor); lion.Accept(visitor); dolphin.Accept(visitor); }
public void Visit(Lion lion) { lion.Roar(); }