private string GetRobotAt(RobotPosition robo) { if (robo == null) return string.Empty; // eg. Output: 0,0,WEST return String.Format(">> Robot At: {0},{1},{2}", robo.XVal, robo.YVal, robo.Facing); }
public SimulationServices(RobotPosition robot) { _robotAt = robot; // Initialize and configure default placement settings _configs = ConfigurePlacements(); }
public string PerformAction(InputInfo inputInfo) { switch (inputInfo.CmdKey) { case Commands.PLACE: _robotAt = Place(inputInfo); break; case Commands.MOVE: _robotAt = Move(inputInfo); break; case Commands.LEFT: _robotAt = Turning(inputInfo, Turns.Left); break; case Commands.RIGHT: _robotAt = Turning(inputInfo, Turns.Right); break; case Commands.REPORT: return GetRobotAt(_robotAt); break; default: return("Oops something gone wrong!"); break; } return string.Empty; }