#pragma once
#include <string_view>
#include <unordered_map>

namespace yrtr {
namespace backend {

enum class Tech {
  kUnknown = -1,
  ORCA,
  HORNET,
  BEAG,
  GAPOWR,
  GAREFN,
  GACNST,
  GAPILE,
  GASAND,
  GADEPT,
  GATECH,
  GAWEAP,
  CALAB,
  NAPOWR,
  NATECH,
  NAHAND,
  GAWALL,
  NARADR,
  NAWEAP,
  NAREFN,
  NAWALL,
  NAPSIS,
  NALASR,
  NASAM,
  CASYDN02,
  GAYARD,
  NAIRON,
  NACNST,
  NADEPT,
  GACSPH,
  GAWEAT,
  CABHUT,
  CAHOSP,
  TESLA,
  NAMISL,
  ATESLA,
  CAMACH,
  CASYDN03,
  AMMOCRAT,
  NAYARD,
  GASPYSAT,
  GAGAP,
  GTGCAN,
  NANRCT,
  GAPILL,
  NAFLAK,
  CAOUTP,
  CATHOSP,
  CAAIRP,
  CAOILD,
  NACLON,
  GAOREP,
  CANEWY04,
  CANEWY05,
  CATECH01,
  CAWASH01,
  CAMISC01,
  CAMISC02,
  CAPARS01,
  GAAIRC,
  CAFRMB,
  AMRADR,
  CAGARD01,
  MAYAN,
  CAMEX01,
  CARUS03,
  CAPARS11,
  CAFARM06,
  NAPSYB,
  NAPSYA,
  CACOLO01,
  CAMSC13,
  CASLAB,
  CATRAN03,
  CAPOWR,
  CABUNK03,
  CABUNK04,
  YACNST,
  YAPOWR,
  YAREFN,
  YABRCK,
  YATECH,
  YAWEAP,
  NABNKR,
  YAGGUN,
  YAPSYT,
  NATBNK,
  GAFWLL,
  YAYARD,
  E1,
  E2,
  SHK,
  ENGINEER,
  JUMPJET,
  GHOST,
  YURI,
  IVAN,
  DESO,
  DOG,
  CTECH,
  CLEG,
  SPY,
  CCOMAND,
  PTROOP,
  CIVAN,
  YURIPR,
  SNIPE,
  COW,
  ALL,
  TANY,
  FLAKT,
  TERROR,
  SENGINEER,
  ADOG,
  VLADIMIR,
  PENTGEN,
  PRES,
  SSRV,
  POLARB,
  JOSH,
  CLNT,
  ARND,
  STLN,
  CAML,
  EINS,
  MUMY,
  RMNV,
  LUNR,
  DNOA,
  DNOB,
  WWLF,
  BRUTE,
  AMCV,
  HARV,
  APOC,
  HTNK,
  SAPC,
  MTNK,
  HORV,
  CARRIER,
  V3,
  ZEP,
  DRON,
  HTK,
  DEST,
  SUB,
  AEGIS,
  LCRF,
  DRED,
  SHAD,
  SQD,
  DLPH,
  SMCV,
  TNKD,
  HOWI,
  TTNK,
  HIND,
  LTNK,
  CMON,
  CMIN,
  SREF,
  HYD,
  MGTK,
  FV,
  VLAD,
  DTRUCK,
  CRUISE,
  YDUM,
  PCV,
  kCount,
};

inline Tech GetTech(std::string_view tech_id) {
  static const std::unordered_map<std::string_view, Tech> kTechTable{
      {"ORCA", Tech::ORCA},
      {"HORNET", Tech::HORNET},
      {"BEAG", Tech::BEAG},
      {"GAPOWR", Tech::GAPOWR},
      {"GAREFN", Tech::GAREFN},
      {"GACNST", Tech::GACNST},
      {"GAPILE", Tech::GAPILE},
      {"GASAND", Tech::GASAND},
      {"GADEPT", Tech::GADEPT},
      {"GATECH", Tech::GATECH},
      {"GAWEAP", Tech::GAWEAP},
      {"CALAB", Tech::CALAB},
      {"NAPOWR", Tech::NAPOWR},
      {"NATECH", Tech::NATECH},
      {"NAHAND", Tech::NAHAND},
      {"GAWALL", Tech::GAWALL},
      {"NARADR", Tech::NARADR},
      {"NAWEAP", Tech::NAWEAP},
      {"NAREFN", Tech::NAREFN},
      {"NAWALL", Tech::NAWALL},
      {"NAPSIS", Tech::NAPSIS},
      {"NALASR", Tech::NALASR},
      {"NASAM", Tech::NASAM},
      {"CASYDN02", Tech::CASYDN02},
      {"GAYARD", Tech::GAYARD},
      {"NAIRON", Tech::NAIRON},
      {"NACNST", Tech::NACNST},
      {"NADEPT", Tech::NADEPT},
      {"GACSPH", Tech::GACSPH},
      {"GAWEAT", Tech::GAWEAT},
      {"CABHUT", Tech::CABHUT},
      {"CAHOSP", Tech::CAHOSP},
      {"TESLA", Tech::TESLA},
      {"NAMISL", Tech::NAMISL},
      {"ATESLA", Tech::ATESLA},
      {"CAMACH", Tech::CAMACH},
      {"CASYDN03", Tech::CASYDN03},
      {"AMMOCRAT", Tech::AMMOCRAT},
      {"NAYARD", Tech::NAYARD},
      {"GASPYSAT", Tech::GASPYSAT},
      {"GAGAP", Tech::GAGAP},
      {"GTGCAN", Tech::GTGCAN},
      {"NANRCT", Tech::NANRCT},
      {"GAPILL", Tech::GAPILL},
      {"NAFLAK", Tech::NAFLAK},
      {"CAOUTP", Tech::CAOUTP},
      {"CATHOSP", Tech::CATHOSP},
      {"CAAIRP", Tech::CAAIRP},
      {"CAOILD", Tech::CAOILD},
      {"NACLON", Tech::NACLON},
      {"GAOREP", Tech::GAOREP},
      {"CANEWY04", Tech::CANEWY04},
      {"CANEWY05", Tech::CANEWY05},
      {"CATECH01", Tech::CATECH01},
      {"CAWASH01", Tech::CAWASH01},
      {"CAMISC01", Tech::CAMISC01},
      {"CAMISC02", Tech::CAMISC02},
      {"CAPARS01", Tech::CAPARS01},
      {"GAAIRC", Tech::GAAIRC},
      {"CAFRMB", Tech::CAFRMB},
      {"AMRADR", Tech::AMRADR},
      {"CAGARD01", Tech::CAGARD01},
      {"MAYAN", Tech::MAYAN},
      {"CAMEX01", Tech::CAMEX01},
      {"CARUS03", Tech::CARUS03},
      {"CAPARS11", Tech::CAPARS11},
      {"CAFARM06", Tech::CAFARM06},
      {"NAPSYB", Tech::NAPSYB},
      {"NAPSYA", Tech::NAPSYA},
      {"CACOLO01", Tech::CACOLO01},
      {"CAMSC13", Tech::CAMSC13},
      {"CASLAB", Tech::CASLAB},
      {"CATRAN03", Tech::CATRAN03},
      {"CAPOWR", Tech::CAPOWR},
      {"CABUNK03", Tech::CABUNK03},
      {"CABUNK04", Tech::CABUNK04},
      {"YACNST", Tech::YACNST},
      {"YAPOWR", Tech::YAPOWR},
      {"YAREFN", Tech::YAREFN},
      {"YABRCK", Tech::YABRCK},
      {"YATECH", Tech::YATECH},
      {"YAWEAP", Tech::YAWEAP},
      {"NABNKR", Tech::NABNKR},
      {"YAGGUN", Tech::YAGGUN},
      {"YAPSYT", Tech::YAPSYT},
      {"NATBNK", Tech::NATBNK},
      {"GAFWLL", Tech::GAFWLL},
      {"YAYARD", Tech::YAYARD},
      {"E1", Tech::E1},
      {"E2", Tech::E2},
      {"SHK", Tech::SHK},
      {"ENGINEER", Tech::ENGINEER},
      {"JUMPJET", Tech::JUMPJET},
      {"GHOST", Tech::GHOST},
      {"YURI", Tech::YURI},
      {"IVAN", Tech::IVAN},
      {"DESO", Tech::DESO},
      {"DOG", Tech::DOG},
      {"CTECH", Tech::CTECH},
      {"CLEG", Tech::CLEG},
      {"SPY", Tech::SPY},
      {"CCOMAND", Tech::CCOMAND},
      {"PTROOP", Tech::PTROOP},
      {"CIVAN", Tech::CIVAN},
      {"YURIPR", Tech::YURIPR},
      {"SNIPE", Tech::SNIPE},
      {"COW", Tech::COW},
      {"ALL", Tech::ALL},
      {"TANY", Tech::TANY},
      {"FLAKT", Tech::FLAKT},
      {"TERROR", Tech::TERROR},
      {"SENGINEER", Tech::SENGINEER},
      {"ADOG", Tech::ADOG},
      {"VLADIMIR", Tech::VLADIMIR},
      {"PENTGEN", Tech::PENTGEN},
      {"PRES", Tech::PRES},
      {"SSRV", Tech::SSRV},
      {"POLARB", Tech::POLARB},
      {"JOSH", Tech::JOSH},
      {"CLNT", Tech::CLNT},
      {"ARND", Tech::ARND},
      {"STLN", Tech::STLN},
      {"CAML", Tech::CAML},
      {"EINS", Tech::EINS},
      {"MUMY", Tech::MUMY},
      {"RMNV", Tech::RMNV},
      {"LUNR", Tech::LUNR},
      {"DNOA", Tech::DNOA},
      {"DNOB", Tech::DNOB},
      {"WWLF", Tech::WWLF},
      {"BRUTE", Tech::BRUTE},
      {"AMCV", Tech::AMCV},
      {"HARV", Tech::HARV},
      {"APOC", Tech::APOC},
      {"HTNK", Tech::HTNK},
      {"SAPC", Tech::SAPC},
      {"MTNK", Tech::MTNK},
      {"HORV", Tech::HORV},
      {"CARRIER", Tech::CARRIER},
      {"V3", Tech::V3},
      {"ZEP", Tech::ZEP},
      {"DRON", Tech::DRON},
      {"HTK", Tech::HTK},
      {"DEST", Tech::DEST},
      {"SUB", Tech::SUB},
      {"AEGIS", Tech::AEGIS},
      {"LCRF", Tech::LCRF},
      {"DRED", Tech::DRED},
      {"SHAD", Tech::SHAD},
      {"SQD", Tech::SQD},
      {"DLPH", Tech::DLPH},
      {"SMCV", Tech::SMCV},
      {"TNKD", Tech::TNKD},
      {"HOWI", Tech::HOWI},
      {"TTNK", Tech::TTNK},
      {"HIND", Tech::HIND},
      {"LTNK", Tech::LTNK},
      {"CMON", Tech::CMON},
      {"CMIN", Tech::CMIN},
      {"SREF", Tech::SREF},
      {"HYD", Tech::HYD},
      {"MGTK", Tech::MGTK},
      {"FV", Tech::FV},
      {"VLAD", Tech::VLAD},
      {"DTRUCK", Tech::DTRUCK},
      {"CRUISE", Tech::CRUISE},
      {"YDUM", Tech::YDUM},
      {"PCV", Tech::PCV},
  };
  if (auto it = kTechTable.find(tech_id); it != kTechTable.end()) {
    return it->second;
  } else {
    return Tech::kUnknown;
  }
}

using TechList = std::array<bool, static_cast<int>(Tech::kCount)>;

}  // namespace backend
}  // namespace yrtr
