operator + method

TimeDistance operator +(
  1. TimeDistance other
)

Adds two TimeDistance instances together.

Parameters:

Returns:

  • A new TimeDistance instance representing the sum of the two instances.

Implementation

TimeDistance operator +(final TimeDistance other) {
  return TimeDistance(
    unrestrictedTimeS: unrestrictedTimeS + other.unrestrictedTimeS,
    restrictedTimeS: restrictedTimeS + other.restrictedTimeS,
    unrestrictedDistanceM:
        unrestrictedDistanceM + other.unrestrictedDistanceM,
    restrictedDistanceM: restrictedDistanceM + other.restrictedDistanceM,
  );
}