public void Accept(IAlienVisitor visitor) { Console.WriteLine("Fleet accepts a visitor: " + visitor); motherships.ForEach(ship => ship.Accept(visitor)); harvesters.ForEach(ship => ship.Accept(visitor)); fighters.ForEach(ship => ship.Accept(visitor)); }
public void Accept(IAlienVisitor visitor) { visitor.VisitShip(this); }