Example #1
0
 /// <summary>
 /// Based on time of day, indicates if ambient lights should be turned on
 /// </summary>
 /// <param name="tod"></param>
 /// <returns>true if lights should be on</returns>
 public bool AreAmbientLightsOn(TimeOfDay tod)
 {
     return(GetTimeOfDayPhase(tod) != TimeOfDayPhases.Daytime);
 }
Example #2
0
        /// <summary>
        /// With the sun at top (270degrees) this will return the number of degrees to rotate by based
        /// on the time of day
        /// </summary>
        /// <param name="timeOfDay">current time of day</param>
        /// <returns></returns>
        public float GetMoonAngle(TimeOfDay timeOfDay)
        {
            float moonPercentageOfDay = ((float)timeOfDay.Hour * 60f + (float)timeOfDay.Minute) / (60f * 24f);

            return(moonPercentageOfDay * 360f);
        }