/// <summary> /// Change the times of this <see cref="TrainLocationTime" /> by reflecting them over another time. In other words, if beforehand the train arrives ten minutes before and departs five /// minutes before the reflection time, then afterwards, the train will arrive five minutes after and depart ten minutes after the reflection time. /// </summary> /// <param name="aroundTime">The time to reflect about.</param> /// <param name="alwaysSwap">If this parameter is false (the default), if the object only has a <see cref="DepartureTime" />, the reflected time will still be the /// <see cref="DepartureTime" />. If it is true, then if the object only has a <see cref="DepartureTime" /> it will become the <see cref="ArrivalTime" />.</param> public void Reflect(TimeOfDay aroundTime, bool alwaysSwap = false) { TrainTime newArrivalTime = DepartureTime?.CopyAndReflect(aroundTime); TrainTime newDepartureTime = ArrivalTime?.CopyAndReflect(aroundTime); if (newDepartureTime?.Time == null && newArrivalTime?.Time != null && !alwaysSwap) { DepartureTime = newArrivalTime; ArrivalTime = newDepartureTime; } else { DepartureTime = newDepartureTime; ArrivalTime = newArrivalTime; } }