Example #1
0
        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));
        }
Example #2
0
 public void Accept(IAlienVisitor visitor)
 {
     visitor.VisitShip(this);
 }