sc2simulator/scenarioMgr/bank.py
def findUnitRace(unit):
            """locate the race in predefined data of unit given its name"""
            name = unit.nametype
            for race, data in codeMap.items():
                for uType, codes in data.items():
                    for code, target in codes.items():
                        if name != target:  continue
                        unit.code = code # also update the unit's code type
                        return race
            print("WARNING: failed to locate the race of unit '%s'."%name)
            return None
locate the race in predefined data of unit given its name
locate the race in predefined data of unit given its name
locate the race in predefined data of unit given its name
def findUnitRace(unit):
            name = unit.nametype
            for race, data in codeMap.items():
                for uType, codes in data.items():
                    for code, target in codes.items():
                        if name != target:  continue
                        unit.code = code 
                        return race
            print("WARNING: failed to locate the race of unit '%s'."%name)
            return None
def findUnitRace ( unit ) : name = unit . nametype for race , data in codeMap . items ( ) : for uType , codes in data . items ( ) : for code , target in codes . items ( ) : if name != target : continue unit . code = code return race print ( "WARNING: failed to locate the race of unit '%s'." % name ) return None
locate the race in predefined data of unit given its name
locate the race in predefined data of unit given its name
"""locate the race in predefined data of unit given its name""" # also update the unit's code type
unit