Beispiel #1
0
        public static RobotCollection LandingRobots(InstructionSet instructionSet)
        {
            var robotCollection = new RobotCollection();

            Plateau plateau = instructionSet.GetPlateau();

            foreach (IInstruction instruction in instructionSet)
            {
                var robot = new Robot(robotCollection.Count
                                      , instruction.GetLandingPosition()
                                      , instruction.GetLandingHeading()
                                      , instruction.GetMovingSequence()
                                      , plateau);

                robotCollection.Add(robot);
            }

            return robotCollection;
        }
Beispiel #2
0
 public void Add(Robot robot)
 {
     robot.ReportedPosition += RobotReportedPosition;
     _robots.Add(robot);
 }