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

            foreach (char cmd in commandsLine)
            {
                NasaMission.Instance.AddCommand(CommandFactory.Create(cmd, rover));
            }
        }
Esempio 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();
        }
Esempio n. 3
0
 private void AddRoverAndCommands()
 {
     while (true)
     {
         string line = Rreader.ReadLine();
         if (string.IsNullOrEmpty(line))
         {
             break;
         }
         else
         {
             Rover r = AddRover(line);
             AddCommands(r);
         }
     }
 }