def getScores(self): defaultScores = [("50000", "5", "AAA", "doh/01.png"), ("45000", "4", "BBB", "doh/01.png"), ("40000", "3", "CCC", "doh/01.png"), ("35000", "2", "DDD", "doh/01.png"), ("30000", "1", "EEE", "doh/01.png")] scores = utilities.loadScores() # ...1 = classic mode try: l1 = utilities.setSortedScores(scores["local1"]) except: l1 = utilities.setSortedScores(defaultScores) try: o1 = utilities.setSortedScores(scores["online1"]) except: o1 = utilities.setSortedScores(defaultScores) # ...2 = tournament mode try: l2 = utilities.setSortedScores(scores["local2"]) except: l2 = utilities.setSortedScores(defaultScores) try: o2 = utilities.setSortedScores(scores["online2"]) except: o2 = utilities.setSortedScores(defaultScores) return {"local1": l1, "local2": l2, "online1": o1, "online2": o2}
def getScores(self): defaultScores = [ ("50000", "5", "AAA", "doh/01.png"), ("45000", "4", "BBB", "doh/01.png"), ("40000", "3", "CCC", "doh/01.png"), ("35000", "2", "DDD", "doh/01.png"), ("30000", "1", "EEE", "doh/01.png"), ] scores = utilities.loadScores() # ...1 = classic mode try: l1 = utilities.setSortedScores(scores["local1"]) except: l1 = utilities.setSortedScores(defaultScores) try: o1 = utilities.setSortedScores(scores["online1"]) except: o1 = utilities.setSortedScores(defaultScores) # ...2 = tournament mode try: l2 = utilities.setSortedScores(scores["local2"]) except: l2 = utilities.setSortedScores(defaultScores) try: o2 = utilities.setSortedScores(scores["online2"]) except: o2 = utilities.setSortedScores(defaultScores) return {"local1": l1, "local2": l2, "online1": o1, "online2": o2}
def getHighScores( self ): defaultScores = [ ( "50000", "5", "AAA", "doh/01.png" ), ( "45000", "4", "BBB", "doh/01.png" ), ( "40000", "3", "CCC", "doh/01.png" ), ( "35000", "2", "DDD", "doh/01.png" ), ( "30000", "1", "EEE", "doh/01.png" ) ] scores = utilities.loadScores() # ...1 = classic mode try: l1 = scores[ "local1" ] except: l1 = defaultScores try: o1 = scores[ "online1" ] except: o1 = defaultScores try: high1 = utilities.setSortedScores( l1+o1 )[ 0 ][ 0 ] except: high1 = "50000" # ...2 = tournament mode try: l2 = scores[ "local2" ] except: l2 = defaultScores try: o2 = scores[ "online2" ] except: o2 = defaultScores try: high2 = utilities.setSortedScores( l2+o2 )[ 0 ][ 0 ] except: high2 = "50000" return high1, high2
def getHighScores(self): defaultScores = [("50000", "5", "AAA", "doh/01.png"), ("45000", "4", "BBB", "doh/01.png"), ("40000", "3", "CCC", "doh/01.png"), ("35000", "2", "DDD", "doh/01.png"), ("30000", "1", "EEE", "doh/01.png")] scores = utilities.loadScores() # ...1 = classic mode try: l1 = scores["local1"] except: l1 = defaultScores try: o1 = scores["online1"] except: o1 = defaultScores try: high1 = utilities.setSortedScores(l1 + o1)[0][0] except: high1 = "50000" # ...2 = tournament mode try: l2 = scores["local2"] except: l2 = defaultScores try: o2 = scores["online2"] except: o2 = defaultScores try: high2 = utilities.setSortedScores(l2 + o2)[0][0] except: high2 = "50000" return high1, high2