sc2simulator/setup/mapLocations.py
def defineLocs(locP1, locP2, d):
    """ensure both player locations are defined as map location tuples"""
    global mapDimensions
    dim = mapDimensions
    if not any([locP1, locP2]): # neither location is defined
        locP1 = pickValidMapLoc()
        locP2 = pickBoundMapLoc(locP1, d)
    elif locP1:
        locP1 = convertStrToPoint(locP1, dim)
        locP2 = pickBoundMapLoc(locP1, d)
    elif locP2:
        locP2 = convertStrToPoint(locP2, dim)
        locP1 = pickBoundMapLoc(locP2, d)
    else: # both player locs are defined already
        locP1 = convertStrToPoint(locP1, dim)
        locP2 = convertStrToPoint(locP2, dim)
    return (locP1, locP2)
ensure both player locations are defined as map location tuples
ensure both player locations are defined as map location tuples
ensure both player locations are defined as map location tuples
def defineLocs(locP1, locP2, d):
    global mapDimensions
    dim = mapDimensions
    if not any([locP1, locP2]): 
        locP1 = pickValidMapLoc()
        locP2 = pickBoundMapLoc(locP1, d)
    elif locP1:
        locP1 = convertStrToPoint(locP1, dim)
        locP2 = pickBoundMapLoc(locP1, d)
    elif locP2:
        locP2 = convertStrToPoint(locP2, dim)
        locP1 = pickBoundMapLoc(locP2, d)
    else: 
        locP1 = convertStrToPoint(locP1, dim)
        locP2 = convertStrToPoint(locP2, dim)
    return (locP1, locP2)
def defineLocs ( locP1 , locP2 , d ) : global mapDimensions dim = mapDimensions if not any ( [ locP1 , locP2 ] ) : locP1 = pickValidMapLoc ( ) locP2 = pickBoundMapLoc ( locP1 , d ) elif locP1 : locP1 = convertStrToPoint ( locP1 , dim ) locP2 = pickBoundMapLoc ( locP1 , d ) elif locP2 : locP2 = convertStrToPoint ( locP2 , dim ) locP1 = pickBoundMapLoc ( locP2 , d ) else : locP1 = convertStrToPoint ( locP1 , dim ) locP2 = convertStrToPoint ( locP2 , dim ) return ( locP1 , locP2 )
ensure both player locations are defined as map location tuples
ensure both player locations are defined as map location tuples
"""ensure both player locations are defined as map location tuples""" # neither location is defined # both player locs are defined already
locP1
locP2
d