Advertisement
Tkap1

Untitled

Aug 5th, 2022
984
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.11 KB | None | 0 0
  1. // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv     THIS
  2. data_enum(e_difficulty,
  3.  
  4.     s_difficulty_data
  5.     g_difficulty_data
  6.  
  7.     normal
  8.     {
  9.         .max_waves = 50,
  10.         .extra_levels = 0,
  11.         .name = "Normal",
  12.     }
  13.  
  14.     hard
  15.     {
  16.         .max_waves = 75,
  17.         .extra_levels = 50,
  18.         .name = "Hard",
  19.     }
  20.  
  21.     insane
  22.     {
  23.         .max_waves = 100,
  24.         .extra_levels = 100,
  25.         .name = "Insane",
  26.     }
  27.  
  28.     nightmare
  29.     {
  30.         .max_waves = 250,
  31.         .extra_levels = 500,
  32.         .name = "Nightmare",
  33.     }
  34. )
  35.  
  36. struct s_difficulty_data
  37. {
  38.     int max_waves;
  39.     int extra_levels;
  40.     char* name;
  41. };
  42.  
  43.  
  44.  
  45. // vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv     GENERATES THIS
  46. enum e_difficulty
  47. {
  48.     e_difficulty_normal,
  49.     e_difficulty_hard,
  50.     e_difficulty_insane,
  51.     e_difficulty_nightmare,
  52.     e_difficulty_count,
  53. };
  54.  
  55. global constexpr s_difficulty_data g_difficulty_data[e_difficulty_count] = {
  56.     {
  57.         .max_waves = 50,
  58.         .extra_levels = 0,
  59.         .name = "Normal",
  60.     },
  61.     {
  62.         .max_waves = 75,
  63.         .extra_levels = 50,
  64.         .name = "Hard",
  65.     },
  66.     {
  67.         .max_waves = 100,
  68.         .extra_levels = 100,
  69.         .name = "Insane",
  70.     },
  71.     {
  72.         .max_waves = 250,
  73.         .extra_levels = 500,
  74.         .name = "Nightmare",
  75.     },
  76. };
  77.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement