from enum import IntEnum


class DiplomacyState(IntEnum):
    ALLY = 0
    NEUTRAL = 1
    ENEMY = 3


class Operator(IntEnum):
    SET = 1
    ADD = 2
    SUBTRACT = 3
    MULTIPLY = 4
    DIVIDE = 5


class ButtonLocation(IntEnum):
    LOCATION_0_0 = 0
    LOCATION_1_0 = 2
    LOCATION_2_0 = 3
    LOCATION_3_0 = 4
    LOCATION_4_0 = 5
    LOCATION_0_1 = 6
    LOCATION_1_1 = 7
    LOCATION_2_1 = 8
    LOCATION_3_1 = 9
    LOCATION_4_1 = 10
    LOCATION_0_2 = 11
    LOCATION_1_2 = 12
    LOCATION_2_2 = 13
    LOCATION_3_2 = 14
    # LOCATION_4_2 = 15? (Actually placed at 0_0 at the moment)


class PanelLocation(IntEnum):
    TOP = 0
    """Panel at the top of the screen. ~13% from the top"""
    BETWEEN = 1
    """Panel between the top and the center of the screen. ~33% from the top"""
    CENTER = 2
    """Panel close to the center of the screen. ~45% from the top"""


class TimeUnit(IntEnum):
    YEARS = 2
    """In-Game years. A year is 5 seconds in-game time."""
    MINUTES = 1
    """In-Game minutes."""
    SECONDS = 0
    """In-Game seconds."""


class VisibilityState(IntEnum):
    VISIBLE = 0
    EXPLORED = 1
    INVISIBLE = 2


class DifficultyLevel(IntEnum):
    EASIEST = 4
    STANDARD = 3
    MODERATE = 2
    HARD = 1
    HARDEST = 0
    # EXTREME = 5  # ???


class TechnologyState(IntEnum):
    DISABLED = 4
    NOT_READY = 3
    READY = 2
    RESEARCHING = 1
    DONE = 0
    # QUEUED = 5  # ???


class Comparison(IntEnum):
    EQUAL = 0
    LESS = 1
    LARGER = 2
    LESS_OR_EQUAL = 3
    LARGER_OR_EQUAL = 4


class ObjectAttribute(IntEnum):
    HIT_POINTS = 0
    LINE_OF_SIGHT = 1
    GARRISON_CAPACITY = 2
    UNIT_SIZE_X = 3
    UNIT_SIZE_Y = 4
    MOVEMENT_SPEED = 5
    ROTATION_SPEED = 6
    ARMOR = 8
    ATTACK = 9
    ATTACK_RELOAD_TIME = 10
    ACCURACY_PERCENT = 11
    MAX_RANGE = 12
    WORK_RATE = 13
    CARRY_CAPACITY = 14
    BASE_ARMOR = 15
    PROJECTILE_UNIT = 16
    ICON_GRAPHICS_ANGLE = 17
    TERRAIN_DEFENSE_BONUS = 18
    ENABLE_SMART_PROJECTILES = 19
    MINIMUM_RANGE = 20
    ARNOUNT_OF_1ST_RESOURCES = 21
    BLAST_WIDTH = 22
    SEARCH_RADIUS = 23
    HERO_STATUS = 40
    FRAME_DELAY = 41
    TRAIN_LOCATION = 42
    TRAIN_BUTTON = 43
    BLAST_LEVEL = 44
    OBJECT_NAME_ID = 50
    SHORT_DESCRIPTION_ID = 51
    TERRAIN_RESTRICTION_ID = 53
    DEAD_UNIT_ID = 57
    RESOURCE_COSTS = 100
    TRAIN_TIME = 101
    TOTAL_MISSILES = 102
    FOOD_COSTS = 103
    WOOD_COSTS = 104
    GOLD_COSTS = 105
    STONE_COSTS = 106
    MAX_TOTAL_MISSILES = 107
    REGENERATION_RATE = 109


class Attribute(IntEnum):
    FOOD_STORAGE = 0
    WOOD_STORAGE = 1
    STONE_STORAGE = 2
    GOLD_STORAGE = 3
    POPULATION_HEADROOM = 4
    CONVERSION_RANGE = 5
    CURRENT_AGE = 6
    RELICS_CAPTURED = 7
    UNUSED_RESOURCE_008 = 8
    TRADE_GOODS = 9
    UNUSED_RESOURCE_010 = 10
    CURRENT_POPULATION = 11
    CORPSE_DECAY_TIME = 12
    REMARKABLE_DISCOVERY = 13
    MONUMENTS_CAPTURED = 14
    MEAT_STORAGE = 15
    BERRY_STORAGE = 16
    FISH_STORAGE = 17
    UNUSED_RESOURCE_018 = 18
    TOTAL_UNITS_OWNED = 19
    UNITS_KILLED = 20
    TECHNOLOGY_COUNT = 21
    PERCENT_MAP_EXPLORED = 22
    CASTLE_AGE_TECH_ID = 23
    IMPERIAL_AGE_TECH_ID = 24
    FEUDAL_AGE_TECH_ID = 25
    ATTACK_WARNING_SOUND_ID = 26
    ENABLE_MONK_CONVERSION = 27
    ENABLE_BUILDING_CONVERSION = 28
    UNUSED_RESOURCE_029 = 29
    UNUSED_RESOURCE_030 = 30
    UNUSED_RESOURCE_031 = 31
    BONUS_POPULATION_CAP = 32
    FOOD_MAINTENANCE = 33
    FAITH = 34
    FAITH_RECHARGING_RATE = 35
    FARM_FOOD_AMOUNT = 36
    CIVILIAN_POPULATION = 37
    UNUSED_RESOURCE_038 = 38
    ALL_TECHS_ACHIEVED = 39
    MILITARY_POPULATION = 40
    CONVERSIONS = 41
    STANDING_NDERS = 42
    RAZINGS = 43
    KILL_RATIO = 44
    SURVIVAL_TO_FINISH = 45
    TRIBUTE_INEFFICIENCY = 46
    GOLD_MINING_PRODUCTIVITY = 47
    TOWN_CENTER_UNAVAILABLE = 48
    GOLD_COUNTER = 49
    REVEAL_ALLY = 50
    UNUSED_RESOURCE_051 = 51
    MONASTERIES = 52
    TRIBUTE_SENT = 53
    ALL_MONUMENTS_CAPTURED = 54
    ALL_RELICS_CAPTURED = 55
    ORE_STORAGE = 56
    KIDNAP_STORAGE = 57
    DARK_AGE_TECH_ID = 58
    UNUSED_RESOURCE_059 = 59
    UNUSED_RESOURCE_060 = 60
    UNUSED_RESOURCE_061 = 61
    BUILDING_HOUSING_RATE = 62
    TAX_GATHER_RATE = 63
    GATHER_ACCUMULATOR = 64
    SALVAGE_DECAY_RATE = 65
    UNUSED_RESOURCE_066 = 66
    CAN_CONVERT = 67
    HIT_POINTS_KILLED = 68
    KILLED_P1 = 69
    KILLED_P2 = 70
    KILLED_P3 = 71
    KILLED_P4 = 72
    KILLED_P5 = 73
    KILLED_P6 = 74
    KILLED_P7 = 75
    KILLED_P8 = 76
    CONVERSION_RESISTANCE = 77
    TRADE_VIG_RATE = 78
    STONE_MINING_PRODUCTIVITY = 79
    QUEUED_UNITS = 80
    TRAINING_COUNT = 81
    START_WITH_UNIT_444_PTWC = 82
    BOARDING_RECHARGE_RATE = 83
    STARTING_VILLAGERS = 84
    RESEARCH_COST_MODIFIER = 85
    RESEARCH_TIME_MODIFIER = 86
    CONVERT_BOATS = 87
    FISH_TRAP_FOOD_AMOUNT = 88
    HEAL_RATE_MODIFIER = 89
    HEALING_RANGE = 90
    STARTING_FOOD = 91
    STARTING_WOOD = 92
    STARTING_STONE = 93
    STARTING_GOLD = 94
    ENABLE_PTWC_KIDNAP_LOOT = 95
    BERSERKER_HEAL_TIMER = 96
    DOMINANT_SHEEP_CONTROL = 97
    BUILDING_COST_SUM = 98
    TECH_COST_SUM = 99
    RELIC_INCOME_SUM = 100
    TRADE_INCOME_SUM = 101
    P1_TRIBUTE = 102
    P2_TRIBUTE = 103
    P3_TRIBUTE = 104
    P4_TRIBUTE = 105
    P5_TRIBUTE = 106
    P6_TRIBUTE = 107
    P7_TRIBUTE = 108
    P8_TRIBUTE = 109
    P1_KILL_VALUE = 110
    P2_KILL_VALUE = 111
    P3_KILL_VALUE = 112
    P4_KILL_VALUE = 113
    P5_KILL_VALUE = 114
    P6_KILL_VALUE = 115
    P7_KILL_VALUE = 116
    P8_KILL_VALUE = 117
    P1_RAZINGS = 118
    P2_RAZINGS = 119
    P3_RAZINGS = 120
    P4_RAZINGS = 121
    P5_RAZINGS = 122
    P6_RAZINGS = 123
    P7_RAZINGS = 124
    P8_RAZINGS = 125
    P1_RAZING_VALUE = 126
    P2_RAZING_VALUE = 127
    P3_RAZING_VALUE = 128
    P4_RAZING_VALUE = 129
    P5_RAZING_VALUE = 130
    P6_RAZING_VALUE = 131
    P7_RAZING_VALUE = 132
    P8_RAZING_VALUE = 133
    STANDING_CASTLES = 134
    HIT_POINTS_RAZED = 135
    KILLS_BY_P1 = 136
    KILLS_BY_P2 = 137
    KILLS_BY_P3 = 138
    KILLS_BY_P4 = 139
    KILLS_BY_P5 = 140
    KILLS_BY_P6 = 141
    KILLS_BY_P7 = 142
    KILLS_BY_P8 = 143
    RAZINGS_BY_P1 = 144
    RAZINGS_BY_P2 = 145
    RAZINGS_BY_P3 = 146
    RAZINGS_BY_P4 = 147
    RAZINGS_BY_P5 = 148
    RAZINGS_BY_P6 = 149
    RAZINGS_BY_P7 = 150
    RAZINGS_BY_P8 = 151
    VALUE_KILLED_BY_OTHERS = 152
    VALUE_RAZED_BY_OTHERS = 153
    KILLED_BY_OTHERS = 154
    RAZED_BY_OTHERS = 155
    TRIBUTE_FROM_P1 = 156
    TRIBUTE_FROM_P2 = 157
    TRIBUTE_FROM_P3 = 158
    TRIBUTE_FROM_P4 = 159
    TRIBUTE_FROM_P5 = 160
    TRIBUTE_FROM_P6 = 161
    TRIBUTE_FROM_P7 = 162
    TRIBUTE_FROM_P8 = 163
    VALUE_CURENT_UNITS = 164
    VALUE_CURRENT_BUILDINGS = 165
    FOOD_TOTAL = 166
    WOOD_TOTAL = 167
    STONE_TOTAL = 168
    GOLD_TOTAL = 169
    TOTAL_VALUE_OF_KILLS = 170
    TOTAL_TRIBUTE_RECEIVED = 171
    TOTAL_VALUE_OF_RAZINGS = 172
    TOTAL_CASTLES_BUILT = 173
    TOTAL_WONDERS_BUILT = 174
    TRIBUTE_SCORE = 175
    CONVERT_MIN_ADJUSFIENT = 176
    CONVERT_MAX_ADJUSTMENT = 177
    CONVERT_RESIST_MIN_ADJUSTMENT = 178
    CONVERT_RESIST_MAX_ADJUSTMENT = 179
    CONVERT_BUILDING_MIN = 180
    CONVERT_BUILDING_MAX = 181
    CONVERT_BUILDING_CHANCE = 182
    REVEAL_ENEMY = 183
    VALUE_WONDERS_CASTLES = 184
    FOOD_SCORE = 185
    WOOD_SCORE = 186
    STONE_SCORE = 187
    GOLD_SCORE = 188
    CHOPPING_PRODUCTIVITY = 189
    FOOD_GATHERING_PRODUCTIVITY = 190
    RELIC_GOLD_PRODUCTION_RATE = 191
    CONVERTED_UNITS_DIE = 192
    THEOCRACY = 193
    CRENELLATIONS = 194
    CONSTRUCTION_RATE_MODIFIER = 195
    HUN_WONDER_DISCOUNT = 196
    SPIES_DISCOUNT = 197
    UNUSED_RESOURCE_198 = 198
    UNUSED_RESOURCE_199 = 199
    UNUSED_RESOURCE_200 = 200
    UNUSED_RESOURCE_201 = 201
    UNUSED_RESOURCE_202 = 202
    UNUSED_RESOURCE_203 = 203
    UNUSED_RESOURCE_204 = 204
    FEITORIA_FOOD_PRODUCTIVITY = 205
    FEITORIA_WOOD_PRODUCTIVITY = 206
    FEITORIA_STONE_PRODUCTIVITY = 207
    FEITORIA_GOLD_PRODUCTIVITY = 208
    REVEAL_ENEMY_TOWN_CENTERS = 209
    RELICS_VISIBLE_ON_MAP = 210
    ELEVATION_HIGHER_BONUS = 211
    ELEVATION_LOWER_BONUS = 212
    RAIDING_PRODUCTIVITY = 213
    MERCENARY_KIPCHAK_COUNT = 214
    MERCENARY_KIPCHAK_LIMIT = 215
    SHEPHERD_PRODUCTIVITY = 216
    SHARED_LINE_OF_SIGHT = 217
