Пример #1
0
        static void Main(string[] args)
        {
            Drone drone = new Drone("Thomas", "http://127.0.0.1:8000/");

            /*drone.Connect();
             * drone.Turn(90);*/
            /*drone.Forward(2);
             * drone.Backward(2);
             * drone.Turn(270);
             * drone.Turn(190);*/

            DroneConnectionProcessor dconp = new DroneConnectionProcessor(drone);
            DroneProcessor           dp    = new DroneProcessor(dconp);
            DroneCommandProcessor    dcomp = new DroneCommandProcessor(dp);

            dcomp.AddCommand(new StartCommand(dp));
            dcomp.AddCommand(new StartCommand(dp));
            dcomp.AddCommand(new StartCommand(dp));
            dcomp.AddCommand(new StartCommand(dp));
            dcomp.AddCommand(new StartCommand(dp));
            dcomp.AddCommand(new StartCommand(dp));

            dcomp.Execute();

            Console.Read();
        }
Пример #2
0
 public RiseCommand(DroneProcessor processor, double squares)
 {
     _processor = processor;
     _squares   = squares;
 }
Пример #3
0
 public TurnCommand(DroneProcessor processor, int degrees)
 {
     _processor = processor;
     _degrees   = degrees;
 }
Пример #4
0
        public DroneCommandProcessor(DroneProcessor droneProcessor)
        {
            this._droneProcessor = droneProcessor;

            this._commands = new Queue <IDroneCommand>();
        }
Пример #5
0
 public ForwardCommand(DroneProcessor processor, double squares)
 {
     _processor = processor;
     _squares   = squares;
 }
Пример #6
0
 public LandCommand(DroneProcessor processor)
 {
     _processor = processor;
 }
Пример #7
0
 public StartCommand(DroneProcessor processor)
 {
     _processor = processor;
 }
Пример #8
0
 public FallCommand(DroneProcessor processor, int squares)
 {
     _processor = processor;
     _squares   = squares;
 }