コード例 #1
0
ファイル: Shuttle.cs プロジェクト: iworm/marsexplorer
        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;
        }
コード例 #2
0
ファイル: RobotCollection.cs プロジェクト: iworm/marsexplorer
 public void Add(Robot robot)
 {
     robot.ReportedPosition += RobotReportedPosition;
     _robots.Add(robot);
 }