public void MoveForward() { if (!_hasBeenPlaced) { _logger?.LogTrace("Not yet placed."); return; } var report = _innerRobot.Report(); var newPosition = new Point(report.Location); switch (report.Orientation) { case Direction.North: newPosition.Offset(0, 1); break; case Direction.East: newPosition.Offset(1, 0); break; case Direction.South: newPosition.Offset(0, -1); break; case Direction.West: newPosition.Offset(-1, 0); break; } if (_environment.CheckInBounds(newPosition)) { _innerRobot.MoveForward(); } else { _logger?.LogTrace($"{newPosition} is out of bounds; command will be ignored"); } }