from enum import IntEnum


class Resource(IntEnum):
    """
    Genie Editor Resource IDs.
    
    Source: https://ageofempires.fandom.com/wiki/Genie_Editor#Resources
    """
    # Storage
    FOOD_STORAGE = 0
    WOOD_STORAGE = 1
    STONE_STORAGE = 2
    GOLD_STORAGE = 3
    POPULATION_HEADROOM = 4
    
    # Game State
    CURRENT_AGE = 6  # 0: Dark, 1: Feudal, 2: Castle, 3: Imperial
    RELICS_CAPTURED = 7
    TRADE_GOODS = 9
    CURRENT_POPULATION = 11
    CORPSE_DECAY_TIME = 12
    REMARKABLE_DISCOVERY = 13
    MONUMENTS_CAPTURED = 14
    MEAT_STORAGE = 15
    BERRY_STORAGE = 16
    FISH_STORAGE = 17
    
    # Stats
    TOTAL_UNITS_OWNED = 19
    UNITS_KILLED = 20
    TECHNOLOGY_COUNT = 21
    PERCENT_MAP_EXPLORED = 22
    
    # Tech IDs
    CASTLE_AGE_TECH_ID = 23
    IMPERIAL_AGE_TECH_ID = 24
    FEUDAL_AGE_TECH_ID = 25
    
    # Mechanics
    ATTACK_WARNING_SOUND_ID = 26
    ENABLE_MONK_CONVERSION = 27
    ENABLE_BUILDING_CONVERSION = 28
    ENABLE_SIEGE_CONVERSION = 29
    BONUS_POPULATION_CAP = 32
    FOOD_MAINTENANCE = 33
    FAITH = 34
    FAITH_RECHARGE_RATE = 35
    FARM_FOOD_AMOUNT = 36
    CIVILIAN_POPULATION = 37
    VILLAGER_POPULATION = 38  # Default 178?! Likely a bug in docs or specific usage
    ALL_TECHS_ACHIEVED = 39
    MILITARY_POPULATION = 40
    CONVERSIONS = 41
    STANDING_WONDERS = 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
    
    # More Stats
    MONASTERIES = 52
    TRIBUTE_SENT = 53
    ALL_MONUMENTS_CAPTURED = 54
    ALL_RELICS_CAPTURED = 55
    ORE_STORAGE = 56
    KIDNAP_STORAGE = 57
    DARK_AGE_TECH_ID = 58
    
    # Gathering/Production Rates
    BUILDING_HOUSING_RATE = 62
    TAX_GATHER_RATE = 63
    GATHER_ACCUMULATOR = 64
    SALVAGE_DECAY_RATE = 65
    ALLOW_FORMATIONS = 66
    CAN_CONVERT = 67
    HIT_POINTS_KILLED = 68
    FARM_FOOD_MULTIPLIER = 69
    SOURCE_MARKET_DOCK_X = 70
    SOURCE_MARKET_DOCK_Y = 71
    CONVERSION_RESISTANCE = 77
    MARKET_EXCHANGE_INEFFICIENCY = 78
    STONE_MINING_PRODUCTIVITY = 79
    QUEUED_UNITS = 80
    TRAINING_COUNT = 81
    START_WITH_PACKED_TOWN_CENTER = 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 Resources
    STARTING_FOOD = 91
    STARTING_WOOD = 92
    STARTING_STONE = 93
    STARTING_GOLD = 94
    ENABLE_PTWC_KIDNAP_LOOT = 95
    NO_DROPSITE_FARMERS = 96
    DOMINANT_SHEEP_CONTROL = 97
    BUILDING_COST_SUM = 98
    TECH_COST_SUM = 99
    RELIC_INCOME_SUM = 100
    TRADE_INCOME_SUM = 101
    
    # 134-197
    STANDING_CASTLES = 134
    HIT_POINTS_RAZED = 135
    VALUE_KILLED_BY_OTHERS = 152
    VALUE_RAZED_BY_OTHERS = 153
    KILLED_BY_OTHERS = 154
    RAZED_BY_OTHERS = 155
    VALUE_CURRENT_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_ADJUSTMENT = 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
    WOOD_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_BONUS = 196
    SPIES_DISCOUNT = 197
    
    # 200+ Special
    REVEAL_MAP = 203  # 1: Explored, 2: Visible
    REVEAL_UNIT_ON_MAP = 204
    FEITORIA_FOOD_PRODUCTIVITY = 205
    FEITORIA_WOOD_PRODUCTIVITY = 206
    FEITORIA_STONE_PRODUCTIVITY = 207
    FEITORIA_GOLD_PRODUCTIVITY = 208
    REVEAL_ENEMY_TOWN_CENTER = 209
    REVEAL_UNIT_CLASS_ON_MAP = 210
    ELEVATION_HIGHER_BONUS = 211
    ELEVATION_LOWER_BONUS = 212
    RAIDING_PRODUCTIVITY = 213
    MERCENARY_KIPCHAK_COUNT = 214
    SHEPHERD_PRODUCTIVITY = 216
    SHARED_LINE_OF_SIGHT = 217
    EARLY_TOWN_CENTER_LIMIT = 218
    FISHING_PRODUCTIVITY = 219
    MONUMENT_FOOD_PRODUCTIVITY = 221
    MONUMENT_WOOD_PRODUCTIVITY = 222
    MONUMENT_STONE_PRODUCTIVITY = 223
    MONUMENT_GOLD_PRODUCTIVITY = 224
    RELIC_FOOD_PRODUCTION_RATE = 225
    VILLAGERS_KILLED_BY_GAIA = 226
    VILLAGERS_KILLED_BY_ANIMALS = 227
    VILLAGERS_KILLED_BY_AI = 228
    VILLAGERS_KILLED_BY_HUMANS = 229
    FOOD_GENERATION_RATE = 230
    WOOD_GENERATION_RATE = 231
    STONE_GENERATION_RATE = 232
    GOLD_GENERATION_RATE = 233
    SPAWN_LIMIT = 234
    FLEMISH_MILITIA_POPULATION = 235
    FARMING_GOLD_PRODUCTIVITY = 236
    FOLWARK_COLLECTION_AMOUNT = 237
    FOLWARK_ATTRIBUTE_TYPE = 238
    FOLWARK_BUILDING_TYPE = 239
    UNITS_CONVERTED = 240
    STONE_MINING_GOLD_PRODUCTIVITY = 241
    TRADE_WORKSHOP_FOOD_GENERATION = 242
    TRADE_WORKSHOP_WOOD_GENERATION = 243
    TRADE_WORKSHOP_STONE_GENERATION = 244
    TRADE_WORKSHOP_GOLD_GENERATION = 245
    UNITS_VALUE_TOTAL = 246
    BUILDINGS_VALUE_TOTAL = 247
    VILLAGERS_CREATED_TOTAL = 248
    VILLAGERS_IDLE_PERIODS_TOTAL = 249
    VILLAGERS_IDLE_SECONDS_TOTAL = 250
    TRADE_FOOD_PERCENT = 251
    TRADE_WOOD_PERCENT = 252
    TRADE_STONE_PERCENT = 253
    LIVESTOCK_FOOD_PRODUCTIVITY = 254
    STARTING_SCOUT_ID = 263
    RELIC_WOOD_PRODUCTION_RATE = 264
    RELIC_STONE_PRODUCTION_RATE = 265
    LUMBERING_GOLD_PRODUCTIVITY = 266
    FORAGING_WOOD_PRODUCTIVITY = 267
    HUNTER_PRODUCTIVITY = 268
    TECHNOLOGY_REWARD_EFFECT = 269
    UNIT_REPAIR_COST = 270
    BUILDING_REPAIR_COST = 271
    ELEVATION_HIGHER_DAMAGE_RESISTANCE = 272
    ELEVATION_LOWER_DAMAGE_RESISTANCE = 273
    INFANTRY_KILL_REWARD = 274
    RED_CLIFFS_TACTICS_DAMAGE = 277
    MILITARY_CAN_CONVERT = 279
    MILITARY_CONVERT_RANGE = 280
    MILITARY_CONVERT_CHANCE = 281
    MILITARY_CONVERT_RECHARGE = 282
    SPAWN_INSIDE = 283
    CAVALRY_KILL_REWARD = 284
    SHARED_VISIBILITY = 285
    SHARED_EXPLORATION = 286
    MILITARY_FOOD_PRODUCTIVITY = 287
    PASTURE_FOOD_AMOUNT = 288
    PASTURE_ANIMAL_COUNT = 289
    PASTURE_HERDER_COUNT = 290
    CHOPPING_FOOD_PRODUCTIVITY = 291
    ANIMAL_DECAY_PREVENTION = 292
    HERDER_FOOD_PRODUCTIVITY = 293
    SHEPHERD_FOOD_PRODUCTIVITY_ALT = 294
    
    # 500+ (Chronicles and others)
    POLEMARCH_LIMIT = 501
    LUMBERING_FOOD_PRODUCTIVITY = 502
    WOOD_TRADE_RATIO = 503
    ACHAEMENID_TC_LOCAL_UPGRADE = 506
    FORTIFIED_OUTPOST_LOCAL_UPGRADE = 508
    MERCENARY_HOPLITE_PRODUCTIVITY = 509
    ODOMANTIAN_RAIDERS_PRODUCTIVITY = 510
    DII_PLUNDERERS_PRODUCTIVITY = 511
    STONE_MINING_FOOD_PRODUCTIVITY = 512
    EMPLACEMENT_LOCAL_UPGRADE = 513
    UNKNOWN_KILL_AWARD = 520
    FORT_GOLD_PRODUCTIVITY = 521
    UNKNOWN_KILL_AWARD_2 = 550
    MELEE_UNIT_KILL_UNITS_AWARD = 551
    FORTIFIED_OUTPOST_REGEN_AURA = 560
    PATTIYODHA_LONGBOWMAN_AURA_1 = 561
    PATTIYODHA_LONGBOWMAN_AURA_2 = 562
    SHEPHERDING_HUNTING_GOLD_PRODUCTIVITY = 563
