You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
504 B
31 lines
504 B
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Visitor
|
|
{
|
|
class CarPrintVisitor : ICarVisitor
|
|
{
|
|
public void Visit(Engine element)
|
|
{
|
|
Console.WriteLine(element.Spec);
|
|
}
|
|
|
|
public void Visit(Body element)
|
|
{
|
|
Console.WriteLine(element.Color);
|
|
}
|
|
|
|
public void Visit(Wheel element)
|
|
{
|
|
Console.WriteLine(element.Type);
|
|
}
|
|
|
|
public void Visit(Car element)
|
|
{
|
|
Console.WriteLine(element.Maker);
|
|
}
|
|
}
|
|
}
|
|
|