Professional Documents
Culture Documents
using RobotHardware;
#endregion
namespace RumbaMumbaRobots.Robot
{
/// <summary>
/// A separate concern of detecting obstacle is implemented in this class.This
will allow different HarwareRobot defines
/// their definition of obstacle since there might be a new HarwareRobot that
can view an obstacle different from
/// the other. It also help in reducing the fat interface of iHarwareRobot.
/// </summary>
public class HardwareRobotObstacleDetector : IHardwareRobotObstacleDetector
{
#region Private Variables
/// <summary>
///
/// </summary>
private readonly IHardwareRobot _hardwareRobot;
#endregion
/// <summary>
///
/// </summary>
/// <param name="hardwareRobot"></param>
public HardwareRobotObstacleDetector(IHardwareRobot hardwareRobot)
{
_hardwareRobot = hardwareRobot;
}
#endregion
/// <summary>
/// Return true if there's an obstacle in front of the robot.
/// </summary>
/// <returns></returns>
public bool IsObstacle()
{
return _hardwareRobot.IsObstacle();
}
#endregion
}
}