def determine_pose(player, subformation): if player.tag in ['L1', 'L2', 'L3', 'L4', 'C', 'D1', 'D2', 'D3', 'D4']: return 'linemanStance' if player.tag in ['D5', 'D6', 'D7', 'D8', 'D9', 'D10', 'D11']: return 'rbStance' if player.tag == 'S1': return 'qbStance' if player.y == 2 else 'qbStanceGun' subformation_players = list(subformation.players.values()) backfield_players = su.get_backfield_ordered(subformation_players) detached_players = su.get_detached_skill_ordered(subformation_players) if player in backfield_players: return 'rbStance' if player in detached_players: return 'wrStance' stance_threshold = 5 if player.y == 1 and player.x <= su.get_rt( subformation_players).x + stance_threshold: return 'linemanStance' if player.y == 1 and player.x >= su.get_lt( subformation_players).x - stance_threshold: return 'linemanStance' return 'rbStance'
def num_backs(subformation): return len(su.get_backfield_ordered(list( subformation.players.values()))) - 1