TimeOfDayHandler contains a delegate that takes two parameters, hence the use of the TwoParams variant of the macro. Our class contains variables to store hours, minutes, and seconds, as well as TimeScale, which is an acceleration factor that's used to speed up time for testing purposes. Inside the handler's Tick function, we accumulate elapsed seconds based on the time elapsed since the last frame. We check if the elapsed seconds have gone over 60. If so, we subtract 60, and increment Minutes. The same happens with Minutes: if they go over 60, we subtract 60, and increment Hours. If Minutes or Hours was updated, we broadcast our delegate to let any object that has subscribed to the delegate know that the time has changed.
The Clock actor uses a series of Scene components and Static meshes to build a mesh hierarchy that resembles a clock face. In the Clock constructor, we parent the components in the hierarchy and set their initial scale and rotations. In BeginPlay, the clock uses GetAllActorsOfClass() to fetch all of the time of day handlers in the level. If there's at least one TimeOfDayHandler in the level, the Clock accesses the first one, and subscribes to its TimeChanged event. When the TimeChanged event fires, the clock rotates the hour and minute hands based on how many hours and minutes the time is currently set at.