#NEWLINE# def isFinished( self ) : #NEWLINE# #INDENT# res = self . env . gameOver ( ) #NEWLINE# if ( res and self . alternateStarting and ( not self . switched ) ) : #NEWLINE# #INDENT# self . opponent . color *= ( - 1 ) #NEWLINE# self . switched = True #NEWLINE# #UNINDENT# return res