#NEWLINE# def check_conditions( self ) : #NEWLINE# #INDENT# leaf = self . ant . world . get ( self . ant . leaf_id ) #NEWLINE# if ( leaf is None ) : #NEWLINE# #INDENT# return 'exploring' #NEWLINE# #UNINDENT# if ( self . ant . location . get_distance_to ( leaf . location ) < 5 ) : #NEWLINE# #INDENT# self . ant . carry ( leaf . image ) #NEWLINE# self . ant . world . remove_entity ( leaf ) #NEWLINE# return 'delivering' #NEWLINE# #UNINDENT# return None