From d2369650a5eac3f2c29aef2ece8f97d356cca4d8 Mon Sep 17 00:00:00 2001
From: Marko Lindqvist <cazfi74@gmail.com>
Date: Sun, 12 May 2024 20:06:25 +0300
Subject: [PATCH 83/83] Generate enum universals_n by generate_enums.py

See RM #602

Signed-off-by: Marko Lindqvist <cazfi74@gmail.com>
---
 common/fc_types.h                    | 132 +--------------------------
 gen_headers/enums/fc_types_enums.def |  73 +++++++++++++++
 2 files changed, 74 insertions(+), 131 deletions(-)

diff --git a/common/fc_types.h b/common/fc_types.h
index e6776dfe41..9acde4a8aa 100644
--- a/common/fc_types.h
+++ b/common/fc_types.h
@@ -745,141 +745,11 @@ typedef union {
   ssetv ssetval;
 } universals_u;
 
-/* The kind of universals_u (value_union_type was req_source_type).
- * Used in the network protocol. */
-#define SPECENUM_NAME universals_n
-#define SPECENUM_VALUE0 VUT_NONE
-#define SPECENUM_VALUE0NAME "None"
-#define SPECENUM_VALUE1 VUT_ADVANCE
-#define SPECENUM_VALUE1NAME "Tech"
-#define SPECENUM_VALUE2 VUT_GOVERNMENT
-#define SPECENUM_VALUE2NAME "Gov"
-#define SPECENUM_VALUE3 VUT_IMPROVEMENT
-#define SPECENUM_VALUE3NAME "Building"
-#define SPECENUM_VALUE4 VUT_TERRAIN
-#define SPECENUM_VALUE4NAME "Terrain"
-#define SPECENUM_VALUE5 VUT_NATION
-#define SPECENUM_VALUE5NAME "Nation"
-#define SPECENUM_VALUE6 VUT_UTYPE
-#define SPECENUM_VALUE6NAME "UnitType"
-#define SPECENUM_VALUE7 VUT_UTFLAG
-#define SPECENUM_VALUE7NAME "UnitFlag"
-#define SPECENUM_VALUE8 VUT_UCLASS
-#define SPECENUM_VALUE8NAME "UnitClass"
-#define SPECENUM_VALUE9 VUT_UCFLAG
-#define SPECENUM_VALUE9NAME "UnitClassFlag"
-#define SPECENUM_VALUE10 VUT_OTYPE
-#define SPECENUM_VALUE10NAME "OutputType"
-#define SPECENUM_VALUE11 VUT_SPECIALIST
-#define SPECENUM_VALUE11NAME "Specialist"
-/* Minimum size: at city range means city size */
-#define SPECENUM_VALUE12 VUT_MINSIZE
-#define SPECENUM_VALUE12NAME "MinSize"
-/* AI level of the player */
-#define SPECENUM_VALUE13 VUT_AI_LEVEL
-#define SPECENUM_VALUE13NAME "AI"
-/* More generic terrain type currently "Land" or "Ocean" */
-#define SPECENUM_VALUE14 VUT_TERRAINCLASS
-#define SPECENUM_VALUE14NAME "TerrainClass"
-#define SPECENUM_VALUE15 VUT_MINYEAR
-#define SPECENUM_VALUE15NAME "MinYear"
-/* Terrain alterations that are possible */
-#define SPECENUM_VALUE16 VUT_TERRAINALTER
-#define SPECENUM_VALUE16NAME "TerrainAlter"
-/* Target tile is used by city. */
-#define SPECENUM_VALUE17 VUT_CITYTILE
-#define SPECENUM_VALUE17NAME "CityTile"
-#define SPECENUM_VALUE18 VUT_GOOD
-#define SPECENUM_VALUE18NAME "Good"
-#define SPECENUM_VALUE19 VUT_TERRFLAG
-#define SPECENUM_VALUE19NAME "TerrainFlag"
-#define SPECENUM_VALUE20 VUT_NATIONALITY
-#define SPECENUM_VALUE20NAME "Nationality"
-#define SPECENUM_VALUE21 VUT_ROADFLAG
-#define SPECENUM_VALUE21NAME "RoadFlag"
-#define SPECENUM_VALUE22 VUT_EXTRA
-#define SPECENUM_VALUE22NAME "Extra"
-#define SPECENUM_VALUE23 VUT_TECHFLAG
-#define SPECENUM_VALUE23NAME "TechFlag"
-#define SPECENUM_VALUE24 VUT_ACHIEVEMENT
-#define SPECENUM_VALUE24NAME "Achievement"
-#define SPECENUM_VALUE25 VUT_DIPLREL
-#define SPECENUM_VALUE25NAME "DiplRel"
-#define SPECENUM_VALUE26 VUT_MAXTILEUNITS
-#define SPECENUM_VALUE26NAME "MaxUnitsOnTile"
-#define SPECENUM_VALUE27 VUT_STYLE
-#define SPECENUM_VALUE27NAME "Style"
-#define SPECENUM_VALUE28 VUT_MINCULTURE
-#define SPECENUM_VALUE28NAME "MinCulture"
-#define SPECENUM_VALUE29 VUT_UNITSTATE
-#define SPECENUM_VALUE29NAME "UnitState"
-#define SPECENUM_VALUE30 VUT_MINMOVES
-#define SPECENUM_VALUE30NAME "MinMoveFrags"
-#define SPECENUM_VALUE31 VUT_MINVETERAN
-#define SPECENUM_VALUE31NAME "MinVeteran"
-#define SPECENUM_VALUE32 VUT_MINHP
-#define SPECENUM_VALUE32NAME "MinHitPoints"
-#define SPECENUM_VALUE33 VUT_AGE
-#define SPECENUM_VALUE33NAME "Age"
-#define SPECENUM_VALUE34 VUT_NATIONGROUP
-#define SPECENUM_VALUE34NAME "NationGroup"
-#define SPECENUM_VALUE35 VUT_TOPO
-#define SPECENUM_VALUE35NAME "Topology"
-#define SPECENUM_VALUE36 VUT_IMPR_GENUS
-#define SPECENUM_VALUE36NAME "BuildingGenus"
-#define SPECENUM_VALUE37 VUT_ACTION
-#define SPECENUM_VALUE37NAME "Action"
-#define SPECENUM_VALUE38 VUT_MINTECHS
-#define SPECENUM_VALUE38NAME "MinTechs"
-#define SPECENUM_VALUE39 VUT_EXTRAFLAG
-#define SPECENUM_VALUE39NAME "ExtraFlag"
-#define SPECENUM_VALUE40 VUT_MINCALFRAG
-#define SPECENUM_VALUE40NAME "MinCalFrag"
-#define SPECENUM_VALUE41 VUT_SERVERSETTING
-#define SPECENUM_VALUE41NAME "ServerSetting"
-#define SPECENUM_VALUE42 VUT_CITYSTATUS
-#define SPECENUM_VALUE42NAME "CityStatus"
-#define SPECENUM_VALUE43 VUT_MINFOREIGNPCT
-#define SPECENUM_VALUE43NAME "MinForeignPct"
-#define SPECENUM_VALUE44 VUT_ACTIVITY
-#define SPECENUM_VALUE44NAME "Activity"
-#define SPECENUM_VALUE45 VUT_DIPLREL_TILE
-#define SPECENUM_VALUE45NAME "DiplRelTile"
-#define SPECENUM_VALUE46 VUT_DIPLREL_TILE_O
-#define SPECENUM_VALUE46NAME "DiplRelTileOther"
-#define SPECENUM_VALUE47 VUT_DIPLREL_UNITANY
-#define SPECENUM_VALUE47NAME "DiplRelUnitAny"
-#define SPECENUM_VALUE48 VUT_DIPLREL_UNITANY_O
-#define SPECENUM_VALUE48NAME "DiplRelUnitAnyOther"
-#define SPECENUM_VALUE49 VUT_MINLATITUDE
-#define SPECENUM_VALUE49NAME "MinLatitude"
-#define SPECENUM_VALUE50 VUT_MAXLATITUDE
-#define SPECENUM_VALUE50NAME "MaxLatitude"
-#define SPECENUM_VALUE51 VUT_COUNTER
-#define SPECENUM_VALUE51NAME "Counter"
-#define SPECENUM_VALUE52 VUT_ORIGINAL_OWNER
-#define SPECENUM_VALUE52NAME "OriginalOwner"
-#define SPECENUM_VALUE53 VUT_IMPR_FLAG
-#define SPECENUM_VALUE53NAME "BuildingFlag"
-#define SPECENUM_VALUE54 VUT_WRAP
-#define SPECENUM_VALUE54NAME "Wrap"
-#define SPECENUM_VALUE55 VUT_PLAYER_FLAG
-#define SPECENUM_VALUE55NAME "PlayerFlag"
-#define SPECENUM_VALUE56 VUT_PLAYER_STATE
-#define SPECENUM_VALUE56NAME "PlayerState"
-#define SPECENUM_VALUE57 VUT_FORM_AGE
-#define SPECENUM_VALUE57NAME "FormAge"
-#define SPECENUM_VALUE58 VUT_MINCITIES
-#define SPECENUM_VALUE58NAME "MinCities"
-
-/* Keep this last. */
-#define SPECENUM_COUNT VUT_COUNT
-#include "specenum_gen.h"
 
 /* Used in the network protocol. */
 struct universal {
   universals_u value;
-  enum universals_n kind;		/* formerly .type and .is_unit */
+  enum universals_n kind;               /* Formerly .type and .is_unit */
 };
 
 /* Used in the network protocol. */
diff --git a/gen_headers/enums/fc_types_enums.def b/gen_headers/enums/fc_types_enums.def
index ef7b744983..4d551bfa97 100644
--- a/gen_headers/enums/fc_types_enums.def
+++ b/gen_headers/enums/fc_types_enums.def
@@ -28,3 +28,76 @@ values
   USER_FLAG_7
   USER_FLAG_8
 end
+
+
+/* The kind of universals_u (value_union_type was req_source_type).
+ * Used in the network protocol. */
+enum universals_n
+  prefix VUT_
+  count
+values
+  NONE               "None"
+  ADVANCE            "Tech"
+  GOVERNMENT         "Gov"
+  IMPROVEMENT        "Building"
+  TERRAIN            "Terrain"
+  NATION             "Nation"
+  UTYPE              "UnitType"
+  UTFLAG             "UnitFlag"
+  UCLASS             "UnitClass"
+  UCFLAG             "UnitClassFlag"
+  OTYPE              "OutputType"
+  SPECIALIST         "Specialist"
+  /* Minimum size: at city range means city size */
+  MINSIZE            "MinSize"
+  /* AI level of the player */
+  AI_LEVEL           "AI"
+  /* More generic terrain type currently "Land" or "Ocean" */
+  TERRAINCLASS       "TerrainClass"
+  MINYEAR            "MinYear"
+  /* Terrain alterations that are possible */
+  TERRAINALTER       "TerrainAlter"
+  /* Target tile is used by city. */
+  CITYTILE           "CityTile"
+  GOOD               "Good"
+  TERRFLAG           "TerrainFlag"
+  NATIONALITY        "Nationality"
+  ROADFLAG           "RoadFlag"
+  EXTRA              "Extra"
+  TECHFLAG           "TechFlag"
+  ACHIEVEMENT        "Achievement"
+  DIPLREL            "DiplRel"
+  MAXTILEUNITS       "MaxUnitsOnTile"
+  STYLE              "Style"
+  MINCULTURE         "MinCulture"
+  UNITSTATE          "UnitState"
+  MINMOVES           "MinMoveFrags"
+  MINVETERAN         "MinVeteran"
+  MINHP              "MinHitPoints"
+  AGE                "Age"
+  NATIONGROUP        "NationGroup"
+  TOPO               "Topology"
+  IMPR_GENUS         "BuildingGenus"
+  ACTION             "Action"
+  MINTECHS           "MinTechs"
+  EXTRAFLAG          "ExtraFlag"
+  MINCALFRAG         "MinCalFrag"
+  SERVERSETTING      "ServerSetting"
+  CITYSTATUS         "CityStatus"
+  MINFOREIGNPCT      "MinForeignPct"
+  ACTIVITY           "Activity"
+  DIPLREL_TILE       "DiplRelTile"
+  DIPLREL_TILE_O     "DiplRelTileOther"
+  DIPLREL_UNITANY    "DiplRelUnitAny"
+  DIPLREL_UNITANY_O  "DiplRelUnitAnyOther"
+  MINLATITUDE        "MinLatitude"
+  MAXLATITUDE        "MaxLatitude"
+  COUNTER            "Counter"
+  ORIGINAL_OWNER     "OriginalOwner"
+  IMPR_FLAG          "BuildingFlag"
+  WRAP               "Wrap"
+  PLAYER_FLAG        "PlayerFlag"
+  PLAYER_STATE       "PlayerState"
+  FORM_AGE           "FormAge"
+  MINCITIES          "MinCities"
+end
-- 
2.43.0

