private static void PrintRoverInfo(IRover rover, string message) { PrintInNewLine(Line); PrintInNewLine($"Energy: {rover.GetEnergy().GetLoad()}"); PrintInNewLine($"Direction: {rover.GetDirection()}"); PrintInNewLine($"Position (x: {rover.GetPosition().GetX()}, y: {rover.GetPosition().GetY()})"); PrintInSameLine("Messages: "); if (message != null) { PrintInSameLine($"{message} ", ConsoleColor.White, ConsoleColor.Black, false); } Jump(); PrintInNewLine(Line); Jump(); }
public Position GetRoverPosition(IRover rover) { return(rover.GetPosition()); }
public void MoveForwardFacingNorth() { // Arrange _rover.SetHeading(Heading.North); // Act var x = _rover.GetPosition().X; var y = _rover.GetPosition().Y; _rover.MoveForward(); // Assert Assert.IsTrue(_rover.GetPosition().X == x && _rover.GetPosition().Y == y + 1); }
public void Execute(IRover rover) { var targetPosition = rover.GetOrientation().GetDiffrenece() + rover.GetPosition(); rover.UpdatePosition(targetPosition); }