OSDN Git Service

[Refactor] #37353 player-class.c/h を作成して player_magic 構造体と関連変数を移動.
authordeskull <deskull@users.sourceforge.jp>
Tue, 30 Apr 2019 11:38:45 +0000 (20:38 +0900)
committerdeskull <deskull@users.sourceforge.jp>
Tue, 30 Apr 2019 11:38:45 +0000 (20:38 +0900)
21 files changed:
Hengband_vcs2017/Hengband/Hengband.vcxproj
Hengband_vcs2017/Hengband/Hengband.vcxproj.filters
src/Makefile.am
src/birth.c
src/cmd-magiceat.c
src/cmd-spell.c
src/cmd4.c
src/core.c
src/dungeon-file.c
src/externs.h
src/init.c
src/load.c
src/mind.c
src/player-class.c [new file with mode: 0644]
src/player-class.h [new file with mode: 0644]
src/player-status.c
src/spells-object.c
src/spells3.c
src/types.h
src/variable.c
src/view-mainwindow.c

index 0ec248c..73124fc 100644 (file)
     <ClCompile Include="..\..\src\objectkind-hook.c" />\r
     <ClCompile Include="..\..\src\object-broken.c" />\r
     <ClCompile Include="..\..\src\patron.c" />\r
+    <ClCompile Include="..\..\src\player-class.c" />\r
     <ClCompile Include="..\..\src\player-damage.c" />\r
     <ClCompile Include="..\..\src\player-effects.c" />\r
     <ClCompile Include="..\..\src\player-skill.c" />\r
     <ClInclude Include="..\..\src\object.h" />\r
     <ClInclude Include="..\..\src\objectkind-hook.h" />\r
     <ClInclude Include="..\..\src\patron.h" />\r
+    <ClInclude Include="..\..\src\player-class.h" />\r
     <ClInclude Include="..\..\src\player-damage.h" />\r
     <ClInclude Include="..\..\src\player-effects.h" />\r
     <ClInclude Include="..\..\src\player-move.h" />\r
index 2166f46..342d0d6 100644 (file)
     <ClCompile Include="..\..\src\dungeon.c">
       <Filter>floor</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\src\player-class.c">
+      <Filter>player</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\src\angband.h" />
     <ClInclude Include="..\..\src\dungeon.h">
       <Filter>floor</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\src\player-class.h">
+      <Filter>player</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <ResourceCompile Include="..\..\src\angband.rc" />
index 65c32da..8a79cce 100644 (file)
@@ -55,7 +55,7 @@ hengband_SOURCES = \
        projection.h projection.c\
        \
        player-move.c player-move.h player-damage.c player-damage.h player-status.c player-status.h \
-       player-effects.c player-effects.h player-skill.c player-skill.h \
+       player-effects.c player-effects.h player-skill.c player-skill.h player-class.c player-class.h \
        \
        quest.h quest.c\
        \
index 9833d38..ca1d2a5 100644 (file)
@@ -22,6 +22,7 @@
 #include "store.h"
 #include "patron.h"
 #include "quest.h"
+#include "player-class.h"
 #include "player-status.h"
 #include "spells.h"
 #include "spells-status.h"
index 97fa4cd..08bf3cb 100644 (file)
@@ -62,6 +62,7 @@
 #include "avatar.h"
 #include "player-status.h"
 #include "spells.h"
+#include "player-class.h"
 
 
 /*!
index f456f97..f425480 100644 (file)
@@ -30,6 +30,7 @@
 #include "player-status.h"
 #include "player-effects.h"
 #include "player-skill.h"
+#include "player-class.h"
 #include "object-hook.h"
 #include "cmd-basic.h"
 #include "view-mainwindow.h"
index 436e471..83517e2 100644 (file)
@@ -64,6 +64,7 @@
 #include "view-mainwindow.h"
 #include "dungeon-file.h"
 #include "files.h"
+#include "player-class.h"
 
 /*
  */
index 20a71ef..f2bf131 100644 (file)
@@ -51,6 +51,7 @@
 #include "avatar.h"
 #include "player-move.h"
 #include "player-status.h"
+#include "player-class.h"
 #include "cmd-spell.h"
 #include "realm-hex.h"
 #include "object-hook.h"
index 080696f..0aa8c9c 100644 (file)
@@ -76,6 +76,7 @@ dungeon_grid letter[255];
 #include "wild.h"
 #include "quest.h"
 #include "view-mainwindow.h"
+#include "player-class.h"
 
 
 
index c058349..2c6b84f 100644 (file)
@@ -230,9 +230,7 @@ extern const player_sex *sp_ptr;
 extern const player_race *rp_ptr;
 extern const player_class *cp_ptr;
 extern const player_seikaku *ap_ptr;
-extern const player_magic *mp_ptr;
 extern birther previous_char;
-extern player_magic *m_info;
 extern char *f_name;
 extern char *f_tag;
 extern object_kind *k_info;
index 1e5c8fd..f03e097 100644 (file)
@@ -50,6 +50,7 @@
 #include "dungeon.h"
 #include "rooms-vault.h"
 #include "player-skill.h"
+#include "player-class.h"
 
 #ifndef MACINTOSH
 #ifdef CHECK_MODIFICATION_TIME
index 510415e..cccd56f 100644 (file)
@@ -67,6 +67,7 @@
 #include "dungeon-file.h"
 #include "files.h"
 #include "player-skill.h"
+#include "player-class.h"
 #include "world.h"
 
 
index 559977c..8de4155 100644 (file)
@@ -26,6 +26,7 @@
 #include "avatar.h"
 #include "player-move.h"
 #include "player-status.h"
+#include "player-class.h"
 #include "spells-status.h"
 #include "cmd-spell.h"
 #include "spells-floor.h"
diff --git a/src/player-class.c b/src/player-class.c
new file mode 100644 (file)
index 0000000..cdc3a93
--- /dev/null
@@ -0,0 +1,9 @@
+
+#include "angband.h"
+#include "player-class.h"
+
+/*
+ * The magic info
+ */
+const player_magic *mp_ptr;
+player_magic *m_info;
diff --git a/src/player-class.h b/src/player-class.h
new file mode 100644 (file)
index 0000000..6bd9f4a
--- /dev/null
@@ -0,0 +1,26 @@
+#pragma once
+
+/*
+ * Information about the player's "magic"
+ *
+ * Note that a player with a "spell_book" of "zero" is illiterate.
+ */
+
+typedef struct player_magic player_magic;
+
+struct player_magic
+{
+       OBJECT_TYPE_VALUE spell_book; /* Tval of spell books (if any) */
+       int spell_xtra;         /* Something for later */
+
+       int spell_stat;         /* Stat for spells (if any)  */
+       int spell_type;         /* Spell type (mage/priest) */
+
+       int spell_first;                /* Level of first spell */
+       int spell_weight;               /* Weight that hurts spells */
+
+       magic_type info[MAX_MAGIC][32];    /* The available spells */
+};
+
+extern player_magic *m_info;
+extern const player_magic *mp_ptr;
index 6ac44c1..8f6ef4f 100644 (file)
@@ -22,6 +22,7 @@
 #include "cmd-pet.h"
 #include "cmd-spell.h"
 #include "dungeon.h"
+#include "player-class.h"
 
 /*!
  * @var horror_desc
index 33eddd5..5688742 100644 (file)
@@ -13,6 +13,7 @@
 #include "player-status.h"
 #include "avatar.h"
 #include "player-effects.h"
+#include "player-class.h"
 
 
 typedef struct
index f66b39f..5143549 100644 (file)
@@ -23,6 +23,7 @@
 #include "melee.h"
 #include "player-move.h"
 #include "player-status.h"
+#include "player-class.h"
 #include "spells-summon.h"
 #include "quest.h"
 #include "artifact.h"
index c19b74c..eaf6036 100644 (file)
@@ -934,30 +934,6 @@ struct magic_type
 
 
 /*
- * Information about the player's "magic"
- *
- * Note that a player with a "spell_book" of "zero" is illiterate.
- */
-
-typedef struct player_magic player_magic;
-
-struct player_magic
-{
-       OBJECT_TYPE_VALUE spell_book; /* Tval of spell books (if any) */
-       int spell_xtra;         /* Something for later */
-
-       int spell_stat;         /* Stat for spells (if any)  */
-       int spell_type;         /* Spell type (mage/priest) */
-
-       int spell_first;                /* Level of first spell */
-       int spell_weight;               /* Weight that hurts spells */
-
-       magic_type info[MAX_MAGIC][32];    /* The available spells */
-};
-
-
-
-/*
  * Player sex info
  */
 
index 4414dc2..cc594c4 100644 (file)
@@ -494,7 +494,6 @@ const player_sex *sp_ptr;
 const player_race *rp_ptr;
 const player_class *cp_ptr;
 const player_seikaku *ap_ptr;
-const player_magic *mp_ptr;
 
 
 /*
@@ -504,11 +503,6 @@ const player_magic *mp_ptr;
 birther previous_char;
 
 /*
- * The magic info
- */
-player_magic *m_info;
-
-/*
  * The object kind arrays
  */
 object_kind *k_info;
index f7aabf3..a951bee 100644 (file)
@@ -19,6 +19,7 @@
 #include "artifact.h"
 #include "avatar.h"
 #include "player-status.h"
+#include "player-class.h"
 #include "monster.h"
 #include "view-mainwindow.h"