import logging

from consts.ranking_indexes import RankingIndexes
from models.event_details import EventDetails


class RankingsHelper(object):
    SORT_ORDERS = {
        2019: [2, 3, 4, 5, 6],
        2018: [2, 3, 4, 5, 6],
        2017: [2, 3, 4, 5, 6, 7],
        2016: [2, 3, 4, 5, 6],
        2015: [2, 5, 3, 4, 7, 6],
        2014: [2, 3, 4, 5, 6],
        2013: [2, 3, 4, 5],
        2012: [2, 3, 4, 5],
        2011: [6, 7],
        2010: [3, 4, 5],
        2009: [6, 7, 8],
        2008: [6, 7, 8],
        2007: [6, 7, 8],
    }

    SORT_ORDER_INFO = {
        2019: [
            {'name': 'Ranking Score',
             'precision': 2},
            {'name': 'Cargo',
             'precision': 0},
            {'name': 'Hatch Panel',
             'precision': 0},
            {'name': 'HAB Climb',
             'precision': 0},
            {'name': 'Sandstorm Bonus',
             'precision': 0}],
        2018: [
            {'name': 'Ranking Score',
             'precision': 2},
            {'name': 'Park/Climb Points',
             'precision': 0},
            {'name': 'Auto',
             'precision': 0},
            {'name': 'Ownership',
             'precision': 0},
            {'name': 'Vault',
             'precision': 0}],
        2017: [
            {'name': 'Ranking Score',
             'precision': 2},
            {'name': 'Match Points',
             'precision': 0},
            {'name': 'Auto',
             'precision': 0},
            {'name': 'Rotor',
             'precision': 0},
            {'name': 'Touchpad',
             'precision': 0},
            {'name': 'Pressure',
             'precision': 0}],
        2016: [
            {'name': 'Ranking Score',
             'precision': 0},
            {'name': 'Auto',
             'precision': 0},
            {'name': 'Scale/Challenge',
             'precision': 0},
            {'name': 'Goals',
             'precision': 0},
            {'name': 'Defense',
             'precision': 0}],
        2015: [
            {'name': 'Qual Avg.',
             'precision': 1},
            {'name': 'Coopertition',