#NEWLINE# def get_time_and_season( self ) : #NEWLINE# #INDENT# '\n        Calculate the current time and season ids.\n        ' #NEWLINE# time = gametime . gametime ( format = True ) #NEWLINE# ( month , hour ) = ( time [ 1 ] , time [ 4 ] ) #NEWLINE# season = ( float ( month ) / MONTHS_PER_YEAR ) #NEWLINE# timeslot = ( float ( hour ) / HOURS_PER_DAY ) #NEWLINE# if ( SEASONAL_BOUNDARIES [ 0 ] <= season < SEASONAL_BOUNDARIES [ 1 ] ) : #NEWLINE# #INDENT# curr_season = 'spring' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( SEASONAL_BOUNDARIES [ 1 ] <= season < SEASONAL_BOUNDARIES [ 2 ] ) : #NEWLINE# #INDENT# curr_season = 'summer' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( SEASONAL_BOUNDARIES [ 2 ] <= self < ( 1.0 + SEASONAL_BOUNDARIES [ 0 ] ) ) : #NEWLINE# #INDENT# curr_season = 'autumn' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# curr_season = 'winter' #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# if ( DAY_BOUNDARIES [ 0 ] <= timeslot < DAY_BOUNDARIES [ 1 ] ) : #NEWLINE# #INDENT# curr_timeslot = 'night' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( DAY_BOUNDARIES [ 1 ] <= timeslot < DAY_BOUNDARIES [ 2 ] ) : #NEWLINE# #INDENT# curr_timeslot = 'morning' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( DAY_BOUNDARIES [ 2 ] <= timeslot < DAY_BOUNDARIES [ 3 ] ) : #NEWLINE# #INDENT# curr_timeslot = 'afternoon' #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# curr_timeslot = 'evening' #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# return ( curr_season , curr_timeslot )