public override void Handle(IMarsRover marsRover) { if (marsRover.CurrentNavigator.Equals('L')) { marsRover.UpdateDirection(Enum_Direction.Direction_N); marsRover.SetCurrentState(NorthPointing); } else if (marsRover.CurrentNavigator.Equals('R')) { marsRover.UpdateDirection(Enum_Direction.Direction_S); marsRover.SetCurrentState(SouthPointing); } else if (marsRover.CurrentNavigator.Equals('M')) { marsRover.UpdateCoordinate(marsRover.CurrentPosition.Xaxis + 1, marsRover.CurrentPosition.Yaxis); } }
public override void Handle(IMarsRover marsRover) { if (marsRover.CurrentNavigator.Equals('L')) { marsRover.UpdateDirection(Enum_Direction.Direction_W); marsRover.SetCurrentState(WestPointing); } else if (marsRover.CurrentNavigator.Equals('R')) { marsRover.UpdateDirection(Enum_Direction.Direction_E); marsRover.SetCurrentState(EastPointing); } else if (marsRover.CurrentNavigator.Equals('M')) { marsRover.UpdateCoordinate(marsRover.CurrentPosition.Xaxis, marsRover.CurrentPosition.Yaxis + 1); } }