Professional Documents
Culture Documents
Hardware Robot Direction
Hardware Robot Direction
Hardware Robot Direction
using RobotHardware;
#endregion
namespace RumbaMumbaRobots.Robot
{
/// <summary>
/// This class is a break down of the fat interface IHardwareRobot and uses
the Interface segregation principle.
/// It defines only the HardwareRobot direction. There is a notion here that a
Hardware robot can turn its direction
/// to any degree without moving and the turning should be independent of its
x,y position on the room.
/// This interface define the concern of HardwareRobot direction - Separation
of concern.
/// </summary>
public class HardwareRobotDirection:IHardwareRobotDirection
{
#region Private Variables
/// <summary>
///
/// </summary>
private readonly IHardwareRobot _hardwareRobot;
#endregion
/// <summary>
///
/// </summary>
/// <param name="hardwareRobot"></param>
public HardwareRobotDirection(IHardwareRobot hardwareRobot)
{
_hardwareRobot = hardwareRobot;
}
#endregion
///// <summary>
///// Turn 90 degrees to the right.
///// </summary>
public void TurnRight()
{
_hardwareRobot.TurnRight();
}
///// <summary>
///// Turn 90 degrees to the left.
///// </summary>
public void TurnLeft()
{
_hardwareRobot.TurnLeft();
}
#endregion
}
}