Exemple #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();
        }
Exemple #2
0
 public RiseCommand(DroneProcessor processor, double squares)
 {
     _processor = processor;
     _squares   = squares;
 }
Exemple #3
0
 public TurnCommand(DroneProcessor processor, int degrees)
 {
     _processor = processor;
     _degrees   = degrees;
 }
Exemple #4
0
        public DroneCommandProcessor(DroneProcessor droneProcessor)
        {
            this._droneProcessor = droneProcessor;

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