using System; using System.Collections.Generic; using System.Text; namespace CSharpAbstractionDemo { class ApplePickerRobot : Robot { // Attributes private List _program; // Constructors public ApplePickerRobot(string name) :base(name) { _program = new List(); } // Properties // Methods public override void SayHello() { Console.WriteLine("10101110101ApplePicker"); } public override void ProgramAction(IAction action) { _program.Add(action); } public override void RunProgram() { int seq = 0; foreach (IAction action in _program) { action.SetupConfig(); action.DoIt(); if (action.IsDone()) { Console.WriteLine("{0} Action {1} complete", GetName(), seq); } seq++; } } } }