How to access variable from component in game mode cpp?

I made a c++ component called DayNightCycle which is attached to the Sun(DirectcionalLight) and in that component I have an enum function that returns if it’s day or night time. I want to access this information from the game mode cpp, but I’m a newbie and can’t think of a way to do it. Maybe I should do the day night cycle differently?