OSDN Git Service

[Refactor] #40413 Separated realm-types.h from realm-names-table.h
authorHourier <hourier@users.sourceforge.jp>
Sat, 13 Jun 2020 11:35:12 +0000 (20:35 +0900)
committerHourier <hourier@users.sourceforge.jp>
Sat, 13 Jun 2020 11:35:12 +0000 (20:35 +0900)
Hengband/Hengband/Hengband.vcxproj
Hengband/Hengband/Hengband.vcxproj.filters
src/Makefile.am
src/player/player-class.h
src/realm/realm-names-table.h
src/realm/realm-types.h [new file with mode: 0644]
src/spell/technic-info-table.h

index 981784c..7257990 100644 (file)
     <ClInclude Include="..\..\src\object-enchant\apply-magic-weapon.h" />\r
     <ClInclude Include="..\..\src\object-enchant\apply-magic.h" />\r
     <ClInclude Include="..\..\src\player\eldritch-horror.h" />\r
+    <ClInclude Include="..\..\src\realm\realm-types.h" />\r
     <ClInclude Include="..\..\src\specific-object\bow.h" />\r
     <ClInclude Include="..\..\src\object\object-stack.h" />\r
     <ClInclude Include="..\..\src\object\object-value-calc.h" />\r
index c0c33ac..18a8c53 100644 (file)
     <ClInclude Include="..\..\src\player\player-race-types.h">
       <Filter>player</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\src\realm\realm-types.h">
+      <Filter>realm</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <None Include="..\..\src\wall.bmp" />
index 6e2d590..47958df 100644 (file)
@@ -457,6 +457,7 @@ hengband_SOURCES = \
        realm/realm-song.c realm/realm-song.h \
        realm/realm-sorcery.c realm/realm-sorcery.h \
        realm/realm-trump.c realm/realm-trump.h \
+       realm/realm-types.h \
        \
        room/rooms.c room/rooms.h room/rooms-city.c room/rooms-city.h \
        room/rooms-fractal.c room/rooms-fractal.h \
index 5f07f9d..49486c1 100644 (file)
@@ -1,10 +1,12 @@
 #pragma once
 
+/* 人畜無害なenumヘッダを先に読み込む */
+#include "player/player-personalities-types.h"
+#include "realm/realm-types.h"
 #include "system/angband.h"
 #include "object/tval-types.h"
 #include "spell/technic-info-table.h"
 #include "player/player-status.h"
-#include "player/player-personalities-types.h"
 
 /*
  * 職業ごとの選択可能な魔法領域現在の所 bitrh.c でのみ使用。
  * Note that a player with a "spell_book" of "zero" is illiterate.
  */
 
-typedef struct player_magic player_magic;
-
-struct player_magic
-{
+typedef struct player_magic {
        tval_type spell_book; /* Tval of spell books (if any) */
        int spell_xtra;         /* Something for later */
 
@@ -50,7 +49,7 @@ struct player_magic
        int spell_weight;               /* Weight that hurts spells */
 
        magic_type info[MAX_MAGIC][32];    /* The available spells */
-};
+} player_magic;
 
 extern player_magic *m_info;
 extern const player_magic *mp_ptr;
index 13d22cf..e2af7cb 100644 (file)
@@ -1,28 +1,7 @@
 #pragma once
 
-/*
- * Magic realms
- */
-#define REALM_NONE         0
-#define REALM_LIFE         1
-#define REALM_SORCERY      2
-#define REALM_NATURE       3
-#define REALM_CHAOS        4
-#define REALM_DEATH        5
-#define REALM_TRUMP        6
-#define REALM_ARCANE       7
-#define REALM_CRAFT        8
-#define REALM_DAEMON       9
-#define REALM_CRUSADE      10
-#define MAX_MAGIC          10
-#define MIN_TECHNIC        16
-#define REALM_MUSIC        16
-#define REALM_HISSATSU     17
-#define REALM_HEX          18
-#define MAX_REALM          18
-
+#include "realm/realm-types.h"
 #define VALID_REALM        (MAX_REALM + MAX_MAGIC - MIN_TECHNIC + 1)
-#define NUM_TECHNIC        (MAX_REALM - MIN_TECHNIC + 1)
 
 #define is_magic(A) ((((A) > REALM_NONE) && ((A) < MAX_MAGIC + 1)) ? TRUE : FALSE)
 #define tval2realm(A) ((A) - TV_LIFE_BOOK + 1)
@@ -32,4 +11,4 @@
 extern const concptr realm_names[];
 #ifdef JP
 extern const concptr E_realm_names[];
-#endif
\ No newline at end of file
+#endif
diff --git a/src/realm/realm-types.h b/src/realm/realm-types.h
new file mode 100644 (file)
index 0000000..51c20fb
--- /dev/null
@@ -0,0 +1,21 @@
+#pragma once
+
+typedef enum magic_realm_type {
+       REALM_NONE = 0,
+    REALM_LIFE = 1,
+    REALM_SORCERY = 2,
+    REALM_NATURE = 3,
+    REALM_CHAOS = 4,
+    REALM_DEATH = 5,
+    REALM_TRUMP = 6,
+    REALM_ARCANE = 7,
+    REALM_CRAFT = 8,
+    REALM_DAEMON = 9,
+    REALM_CRUSADE = 10,
+    MAX_MAGIC = 10,
+    MIN_TECHNIC = 16,
+    REALM_MUSIC = 16,
+    REALM_HISSATSU = 17,
+    REALM_HEX = 18,
+    MAX_REALM = 18,
+} magic_realm_type;
index 888caf2..fa78a93 100644 (file)
@@ -1,5 +1,9 @@
 #pragma once
 
+#include "realm/realm-types.h"
+
+#define NUM_TECHNIC (MAX_REALM - MIN_TECHNIC + 1)
+
 /*
  * The "name" of spell 'N' is stored as spell_names[X][N],
  * where X is 0 for mage-spells and 1 for priest-spells.