import { EnumToArray } from '../../../common/util/util';

export enum DeathReason {
  WEAPON_ELECTRIC_FENCE = 2461879995,
  WEAPON_HIT_BY_WATER_CANNON = 3425972830,
  WEAPON_RAMMED_BY_CAR = 133987706,
  WEAPON_RUN_OVER_BY_CAR = 2741846334,
  WEAPON_FALL = 3452007600,
  WEAPON_ANIMAL = 4194021054,
  WEAPON_AIRSTRIKE_ROCKET = 324506233,
  WEAPON_BLEEDING = 2339582971,
  WEAPON_BRIEFCASE = 2294779575,
  WEAPON_BRIEFCASE_02 = 28811031,
  WEAPON_COUGAR = 148160082,
  WEAPON_BARBED_WIRE = 1223143800,
  WEAPON_DROWNING = 4284007675,
  WEAPON_DROWNING_IN_VEHICLE = 1936677264,
  WEAPON_EXPLOSION = 539292904,
  WEAPON_EXHAUSTION = 910830060,
  WEAPON_FIRE = 3750660587,
  WEAPON_HELI_CRASH = 341774354,
  WEAPON_VEHICLE_ROCKET = 3204302209,
  VEHICLE_WEAPON_AKULA_BARRAGE = 2282558706,
  VEHICLE_WEAPON_AKULA_MINIGUN = 431576697,
  VEHICLE_WEAPON_AKULA_MISSILE = 2092838988,
  VEHICLE_WEAPON_AKULA_TURRET_DUAL = 476907586,
  VEHICLE_WEAPON_AKULA_TURRET_SINGLE = 3048454573,
  VEHICLE_WEAPON_APC_CANNON = 328167896,
  VEHICLE_WEAPON_APC_MG = 190244068,
  VEHICLE_WEAPON_APC_MISSILE = 1151689097,
  VEHICLE_WEAPON_ARDENT_MG = 3293463361,
  VEHICLE_WEAPON_AVENGER_CANNON = 2556895291,
  VEHICLE_WEAPON_BARRAGE_REAR_GL = 2756453005,
  VEHICLE_WEAPON_BARRAGE_REAR_MG = 1200179045,
  VEHICLE_WEAPON_BARRAGE_REAR_MINIGUN = 525623141,
  VEHICLE_WEAPON_BARRAGE_TOP_MG = 4148791700,
  VEHICLE_WEAPON_BARRAGE_TOP_MINIGUN = 1000258817,
  VEHICLE_WEAPON_BOMBUSHKA_CANNON = 3628350041,
  VEHICLE_WEAPON_BOMBUSHKA_DUALMG = 741027160,
  VEHICLE_WEAPON_CANNON_BLAZER = 3959029566,
  VEHICLE_WEAPON_CARACARA_MG = 1817275304,
  VEHICLE_WEAPON_CARACARA_MINIGUN = 1338760315,
  VEHICLE_WEAPON_CHERNO_MISSILE = 2722615358,
  VEHICLE_WEAPON_COMET_MG = 3936892403,
  VEHICLE_WEAPON_DELUXO_MG = 2600428406,
  VEHICLE_WEAPON_DELUXO_MISSILE = 3036244276,
  VEHICLE_WEAPON_DOGFIGHTER_MG = 1595421922,
  VEHICLE_WEAPON_DOGFIGHTER_MISSILE = 3393648765,
  VEHICLE_WEAPON_DUNE_GRENADELAUNCHER = 2700898573,
  VEHICLE_WEAPON_DUNE_MG = 3507816399,
  VEHICLE_WEAPON_DUNE_MINIGUN = 1416047217,
  VEHICLE_WEAPON_ENEMY_LASER = 1566990507,
  VEHICLE_WEAPON_HACKER_MISSILE = 1987049393,
  VEHICLE_WEAPON_HACKER_MISSILE_HOMING = 2011877270,
  VEHICLE_WEAPON_HALFTRACK_DUALMG = 1331922171,
  VEHICLE_WEAPON_HALFTRACK_QUADMG = 1226518132,
  VEHICLE_WEAPON_HAVOK_MINIGUN = 855547631,
  VEHICLE_WEAPON_HUNTER_BARRAGE = 785467445,
  VEHICLE_WEAPON_HUNTER_CANNON = 704686874,
  VEHICLE_WEAPON_HUNTER_MG = 1119518887,
  VEHICLE_WEAPON_HUNTER_MISSILE = 153396725,
  VEHICLE_WEAPON_INSURGENT_MINIGUN = 2861067768,
  VEHICLE_WEAPON_KHANJALI_CANNON = 507170720,
  VEHICLE_WEAPON_KHANJALI_CANNON_HEAVY = 2206953837,
  VEHICLE_WEAPON_KHANJALI_GL = 394659298,
  VEHICLE_WEAPON_KHANJALI_MG = 711953949,
  VEHICLE_WEAPON_MENACER_MG = 3754621092,
  VEHICLE_WEAPON_MICROLIGHT_MG = 3303022956,
  VEHICLE_WEAPON_MOBILEOPS_CANNON = 3846072740,
  VEHICLE_WEAPON_MOGUL_DUALNOSE = 3857952303,
  VEHICLE_WEAPON_MOGUL_DUALTURRET = 3123149825,
  VEHICLE_WEAPON_MOGUL_NOSE = 4128808778,
  VEHICLE_WEAPON_MOGUL_TURRET = 3808236382,
  VEHICLE_WEAPON_MULE4_MG = 2220197671,
  VEHICLE_WEAPON_MULE4_MISSILE = 1198717003,
  VEHICLE_WEAPON_MULE4_TURRET_GL = 3708963429,
  VEHICLE_WEAPON_NIGHTSHARK_MG = 2786772340,
  VEHICLE_WEAPON_NOSE_TURRET_VALKYRIE = 1097917585,
  VEHICLE_WEAPON_OPPRESSOR_MG = 3643944669,
  VEHICLE_WEAPON_OPPRESSOR_MISSILE = 2344076862,
  VEHICLE_WEAPON_OPPRESSOR2_CANNON = 3595383913,
  VEHICLE_WEAPON_OPPRESSOR2_MG = 3796180438,
  VEHICLE_WEAPON_OPPRESSOR2_MISSILE = 1966766321,
  VEHICLE_WEAPON_PLANE_ROCKET = 3473446624,
  VEHICLE_WEAPON_PLAYER_BUZZARD = 1186503822,
  VEHICLE_WEAPON_PLAYER_LAZER = 3800181289,
  VEHICLE_WEAPON_PLAYER_SAVAGE = 1638077257,
  VEHICLE_WEAPON_POUNDER2_BARRAGE = 2456521956,
  VEHICLE_WEAPON_POUNDER2_GL = 2467888918,
  VEHICLE_WEAPON_POUNDER2_MINI = 2263283790,
  VEHICLE_WEAPON_POUNDER2_MISSILE = 162065050,
  VEHICLE_WEAPON_RADAR = 3530961278,
  VEHICLE_WEAPON_REVOLTER_MG = 3177079402,
  VEHICLE_WEAPON_ROGUE_CANNON = 3878337474,
  VEHICLE_WEAPON_ROGUE_MG = 158495693,
  VEHICLE_WEAPON_ROGUE_MISSILE = 1820910717,
  VEHICLE_WEAPON_RUINER_BULLET = 50118905,
  VEHICLE_WEAPON_RUINER_ROCKET = 84788907,
  VEHICLE_WEAPON_SAVESTRA_MG = 3946965070,
  VEHICLE_WEAPON_SCRAMJET_MG = 231629074,
  VEHICLE_WEAPON_SCRAMJET_MISSILE = 3169388763,
  VEHICLE_WEAPON_SEABREEZE_MG = 1371067624,
  VEHICLE_WEAPON_SEARCHLIGHT = 3450622333,
  VEHICLE_WEAPON_SPACE_ROCKET = 4171469727,
  VEHICLE_WEAPON_SPEEDO4_MG = 3355244860,
  VEHICLE_WEAPON_SPEEDO4_TURRET_MG = 3595964737,
  VEHICLE_WEAPON_SPEEDO4_TURRET_MINI = 2667462330,
  VEHICLE_WEAPON_STRIKEFORCE_BARRAGE = 968648323,
  VEHICLE_WEAPON_STRIKEFORCE_CANNON = 955522731,
  VEHICLE_WEAPON_STRIKEFORCE_MISSILE = 519052682,
  VEHICLE_WEAPON_SUBCAR_MG = 1176362416,
  VEHICLE_WEAPON_SUBCAR_MISSILE = 3565779982,
  VEHICLE_WEAPON_SUBCAR_TORPEDO = 3884172218,
  VEHICLE_WEAPON_TAMPA_DUALMINIGUN = 1744687076,
  VEHICLE_WEAPON_TAMPA_FIXEDMINIGUN = 3670375085,
  VEHICLE_WEAPON_TAMPA_MISSILE = 2656583842,
  VEHICLE_WEAPON_TAMPA_MORTAR = 1015268368,
  VEHICLE_WEAPON_TANK = 1945616459,
  VEHICLE_WEAPON_TECHNICAL_MINIGUN = 3683206664,
  VEHICLE_WEAPON_THRUSTER_MG = 1697521053,
  VEHICLE_WEAPON_THRUSTER_MISSILE = 1177935125,
  VEHICLE_WEAPON_TRAILER_DUALAA = 2156678476,
  VEHICLE_WEAPON_TRAILER_MISSILE = 341154295,
  VEHICLE_WEAPON_TRAILER_QUADMG = 1192341548,
  VEHICLE_WEAPON_TULA_DUALMG = 2966510603,
  VEHICLE_WEAPON_TULA_MG = 1217122433,
  VEHICLE_WEAPON_TULA_MINIGUN = 376489128,
  VEHICLE_WEAPON_TULA_NOSEMG = 1100844565,
  VEHICLE_WEAPON_TURRET_BOXVILLE = 3041872152,
  VEHICLE_WEAPON_TURRET_INSURGENT = 1155224728,
  VEHICLE_WEAPON_TURRET_LIMO = 729375873,
  VEHICLE_WEAPON_TURRET_TECHNICAL = 2144528907,
  VEHICLE_WEAPON_TURRET_VALKYRIE = 2756787765,
  VEHICLE_WEAPON_VIGILANTE_MG = 4094131943,
  VEHICLE_WEAPON_VIGILANTE_MISSILE = 1347266149,
  VEHICLE_WEAPON_VISERIS_MG = 2275421702,
  VEHICLE_WEAPON_VOLATOL_DUALMG = 1150790720,
  VEHICLE_WEAPON_WATER_CANNON = 1741783703,
}

export function 
(razaoHash: number) {
  console.log('>>>> razaoMorte ', razaoHash);
  const deathReason = EnumToArray(DeathReason);

  const razaoMorte = deathReason.find((reason) => reason === razaoHash);

  if (!razaoMorte) {
    return 'Desconhecido';
  } else {
    return Object.keys(razaoMorte)[0];
  }
}

razaoMorte