You are on page 1of 1

#region Using Directives

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

#region Class Constuctors

/// <summary>
///
/// </summary>
/// <param name="hardwareRobot"></param>
public HardwareRobotObstacleDetector(IHardwareRobot hardwareRobot)
{
_hardwareRobot = hardwareRobot;
}

#endregion

#region Methods Implementations

/// <summary>
/// Return true if there's an obstacle in front of the robot.
/// </summary>
/// <returns></returns>
public bool IsObstacle()
{
return _hardwareRobot.IsObstacle();
}

#endregion
}
}

You might also like