main
1using System.Collections.Generic;
2using mars.rover.common;
3
4namespace mars.rover.presentation.infrastructure
5{
6 public class SynchronousCommandProcessor : CommandProcessor
7 {
8 readonly Queue<Command> commands = new Queue<Command>();
9
10 public void add(Command command)
11 {
12 commands.Enqueue(command);
13 }
14
15 public void run()
16 {
17 while (commands.Count > 0)
18 commands.Dequeue().run();
19 }
20 }
21}