Hardware Robot Direction

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 2

#region Using Directives

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

#region Class Constuctors

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

#endregion

#region Methods Implementations

///// <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
}
}

You might also like