Exemplo n.º 1
0
        private void AddCommands(Rover rover)
        {
            string commandsLine = Rreader.ReadLine();

            foreach (char cmd in commandsLine)
            {
                NasaMission.Instance.AddCommand(CommandFactory.Create(cmd, rover));
            }
        }
Exemplo n.º 2
0
        private void InitNasaPlan()
        {
            NasaMission.Instance.Clear();

            string[] strs = Rreader.ReadLine().Split(' ');
            NasaMission.Instance.MaxX = int.Parse(strs[0]);
            NasaMission.Instance.MaxY = int.Parse(strs[1]);

            AddRoverAndCommands();
        }
Exemplo n.º 3
0
 private void AddRoverAndCommands()
 {
     while (true)
     {
         string line = Rreader.ReadLine();
         if (string.IsNullOrEmpty(line))
         {
             break;
         }
         else
         {
             Rover r = AddRover(line);
             AddCommands(r);
         }
     }
 }