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