'pos_team is the team on offense, and yardline is a string formatted
like \'team-territory yard-line\'. e.g., "NE 32".
An offset can be given directly by specifying an integer for offset.'

def __init__(self, pos_team=None, yardline=None, offset=None):

    if isinstance(offset, int):
        self.offset = offset
        return
    if (yardline == '50'):
        self.offset = 0
        return
    (territory, yd_str) = yardline.split()
    yd = int(yd_str)
    if (territory == pos_team):
        self.offset = (- (50 - yd))
    else:
        self.offset = (50 - yd)
