示例#1
0
        public AbstractEngine(int size, bool turbo)
        {
            this.size  = size;
            this.turbo = turbo;

            // Create a camshaft, piston and 4 spark plugs...
            camshaft   = new Camshaft();
            piston     = new Piston();
            sparkPlugs = new SparkPlug[]
            {
                new SparkPlug(), new SparkPlug(),
                new SparkPlug(), new SparkPlug()
            };
        }
示例#2
0
 public virtual void Visit(Piston piston)
 {
     pistonCount++;
 }
示例#3
0
 public virtual void Visit(Piston piston)
 {
     Console.WriteLine("Diagnosing the piston");
 }