OSDN Git Service

[Refactor] Separated object-group-table.c/h from cmd-dump.c
authorHourier <hourier@users.sourceforge.jp>
Sun, 8 Mar 2020 11:59:48 +0000 (20:59 +0900)
committerHourier <hourier@users.sourceforge.jp>
Sun, 8 Mar 2020 12:00:19 +0000 (21:00 +0900)
Hengband_vcs2017/Hengband/Hengband.vcxproj
Hengband_vcs2017/Hengband/Hengband.vcxproj.filters
src/Makefile.am
src/cmd/cmd-dump.c
src/cmd/object-group-table.c [new file with mode: 0644]
src/cmd/object-group-table.h [new file with mode: 0644]

index 63a42f5..1ff995c 100644 (file)
     <ClCompile Include="..\..\src\cmd\diary-subtitle-table.c" />\r
     <ClCompile Include="..\..\src\cmd\feeling-table.c" />\r
     <ClCompile Include="..\..\src\cmd\monster-group-table.c" />\r
+    <ClCompile Include="..\..\src\cmd\object-group-table.c" />\r
     <ClCompile Include="..\..\src\combat\melee1.c" />\r
     <ClCompile Include="..\..\src\combat\shoot.c" />\r
     <ClCompile Include="..\..\src\core.c" />\r
     <ClInclude Include="..\..\src\cmd\diary-subtitle-table.h" />\r
     <ClInclude Include="..\..\src\cmd\feeling-table.h" />\r
     <ClInclude Include="..\..\src\cmd\monster-group-table.h" />\r
+    <ClInclude Include="..\..\src\cmd\object-group-table.h" />\r
     <ClInclude Include="..\..\src\combat\melee.h" />\r
     <ClInclude Include="..\..\src\combat\shoot.h" />\r
     <ClInclude Include="..\..\src\core\show-file.h" />\r
index dff2a42..95106bf 100644 (file)
     <ClCompile Include="..\..\src\cmd\diary-subtitle-table.c">
       <Filter>cmd</Filter>
     </ClCompile>
+    <ClCompile Include="..\..\src\cmd\object-group-table.c">
+      <Filter>cmd</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="..\..\src\gamevalue.h" />
     <ClInclude Include="..\..\src\cmd\diary-subtitle-table.h">
       <Filter>cmd</Filter>
     </ClInclude>
+    <ClInclude Include="..\..\src\cmd\object-group-table.h">
+      <Filter>cmd</Filter>
+    </ClInclude>
   </ItemGroup>
   <ItemGroup>
     <None Include="..\..\src\wall.bmp" />
index 244c879..8d69109 100644 (file)
@@ -134,6 +134,7 @@ hengband_SOURCES = \
        cmd/feeling-table.c cmd/feeling-table.h \
        cmd/monster-group-table.c cmd/monster-group-table.h \
        cmd/diary-subtitle-table.c cmd/diary-subtitle-table.h \
+       cmd/object-group-table.c cmd/object-group-table.h \
        cmd/cmd-activate.c cmd/cmd-activate.h cmd/cmd-basic.c cmd/cmd-basic.h \
        cmd/cmd-dump.c cmd/cmd-dump.h cmd/cmd-eat.c cmd/cmd-eat.h \
        cmd/cmd-gameoption.c cmd/cmd-gameoption.h cmd/cmd-help.c cmd/cmd-help.h \
index 09705ea..4907cd5 100644 (file)
@@ -80,6 +80,7 @@
 #include "cmd/feeling-table.h"
 #include "cmd/monster-group-table.h"
 #include "cmd/diary-subtitle-table.h"
+#include "cmd/object-group-table.h"
 #include "view-mainwindow.h" // 暫定。後で消す
 
 #include "english.h"
@@ -1786,153 +1787,6 @@ static IDX collect_monsters(player_type *creature_ptr, IDX grp_cur, IDX mon_idx[
 
 
 /*
- * Description of each monster group.
- */
-static concptr object_group_text[] =
-{
-#ifdef JP
-       "キノコ",    /* "Mushrooms" */
-       "薬",          /* "Potions" */
-       "油つぼ",    /* "Flasks" */
-       "巻物",               /* "Scrolls" */
-       "指輪",               /* "Rings" */
-       "アミュレット",   /* "Amulets" */
-       "笛",          /* "Whistle" */
-       "光源",               /* "Lanterns" */
-       "魔法棒",    /* "Wands" */
-       "杖",          /* "Staffs" */
-       "ロッド",    /* "Rods" */
-       "カード",    /* "Cards" */
-       "キャプチャー・ボール",
-       "羊皮紙",
-       "くさび",
-       "箱",
-       "人形",
-       "像",
-       "ゴミ",
-       "空のビン",
-       "骨",
-       "死体",
-       "刀剣類",    /* "Swords" */
-       "鈍器",               /* "Blunt Weapons" */
-       "長柄武器", /* "Polearms" */
-       "採掘道具", /* "Diggers" */
-       "飛び道具", /* "Bows" */
-       "弾",
-       "矢",
-       "ボルト",
-       "軽装鎧",    /* "Soft Armor" */
-       "重装鎧",    /* "Hard Armor" */
-       "ドラゴン鎧",      /* "Dragon Armor" */
-       "盾",  /* "Shields" */
-       "クローク", /* "Cloaks" */
-       "籠手",       /* "Gloves" */
-       "ヘルメット",      /* "Helms" */
-       "冠",  /* "Crowns" */
-       "ブーツ",    /* "Boots" */
-       "魔法書",
-       "財宝",
-       "何か",
-#else
-       "Mushrooms",
-       "Potions",
-       "Flasks",
-       "Scrolls",
-       "Rings",
-       "Amulets",
-       "Whistle",
-       "Lanterns",
-       "Wands",
-       "Staffs",
-       "Rods",
-       "Cards",
-       "Capture Balls",
-       "Parchments",
-       "Spikes",
-       "Boxs",
-       "Figurines",
-       "Statues",
-       "Junks",
-       "Bottles",
-       "Skeletons",
-       "Corpses",
-       "Swords",
-       "Blunt Weapons",
-       "Polearms",
-       "Diggers",
-       "Bows",
-       "Shots",
-       "Arrows",
-       "Bolts",
-       "Soft Armor",
-       "Hard Armor",
-       "Dragon Armor",
-       "Shields",
-       "Cloaks",
-       "Gloves",
-       "Helms",
-       "Crowns",
-       "Boots",
-       "Spellbooks",
-       "Treasure",
-       "Something",
-#endif
-       NULL
-};
-
-
-/*
- * TVALs of items in each group
- */
-static byte object_group_tval[] =
-{
-       TV_FOOD,
-       TV_POTION,
-       TV_FLASK,
-       TV_SCROLL,
-       TV_RING,
-       TV_AMULET,
-       TV_WHISTLE,
-       TV_LITE,
-       TV_WAND,
-       TV_STAFF,
-       TV_ROD,
-       TV_CARD,
-       TV_CAPTURE,
-       TV_PARCHMENT,
-       TV_SPIKE,
-       TV_CHEST,
-       TV_FIGURINE,
-       TV_STATUE,
-       TV_JUNK,
-       TV_BOTTLE,
-       TV_SKELETON,
-       TV_CORPSE,
-       TV_SWORD,
-       TV_HAFTED,
-       TV_POLEARM,
-       TV_DIGGING,
-       TV_BOW,
-       TV_SHOT,
-       TV_ARROW,
-       TV_BOLT,
-       TV_SOFT_ARMOR,
-       TV_HARD_ARMOR,
-       TV_DRAG_ARMOR,
-       TV_SHIELD,
-       TV_CLOAK,
-       TV_GLOVES,
-       TV_HELM,
-       TV_CROWN,
-       TV_BOOTS,
-       TV_LIFE_BOOK,
-       TV_GOLD,
-       0,
-       0,
-};
-
-
-/*
  * Build a list of object indexes in the given group. Return the number
  * of objects in the group.
  *
diff --git a/src/cmd/object-group-table.c b/src/cmd/object-group-table.c
new file mode 100644 (file)
index 0000000..d7edfaf
--- /dev/null
@@ -0,0 +1,156 @@
+/*
+ * @brief オブジェクト種別を表すテキストの配列群
+ * @date 2020/03/08
+ * @author Hourier
+ */
+
+#include "angband.h"
+#include "object-group-table.h"
+#include "object.h"
+
+/*
+ * todo キャプチャー・ボールではなくモンスター・ボールでは?
+ * Description of each monster group.
+ */
+concptr object_group_text[MAX_OBJECT_GROUP_TEXT] =
+{
+#ifdef JP
+       "キノコ",
+       "薬",
+       "油つぼ",
+       "巻物",
+       "指輪",
+       "アミュレット",
+       "笛",
+       "光源",
+       "魔法棒",
+       "杖",
+       "ロッド",
+       "カード",
+       "キャプチャー・ボール",
+       "羊皮紙",
+       "くさび",
+       "箱",
+       "人形",
+       "像",
+       "ゴミ",
+       "空のビン",
+       "骨",
+       "死体",
+       "刀剣類",
+       "鈍器",
+       "長柄武器",
+       "採掘道具",
+       "飛び道具",
+       "弾",
+       "矢",
+       "ボルト",
+       "軽装鎧",
+       "重装鎧",
+       "ドラゴン鎧",
+       "盾",
+       "クローク",
+       "籠手",
+       "ヘルメット",
+       "冠",
+       "ブーツ",
+       "魔法書",
+       "財宝",
+       "何か",
+#else
+       "Mushrooms",
+       "Potions",
+       "Flasks",
+       "Scrolls",
+       "Rings",
+       "Amulets",
+       "Whistle",
+       "Lanterns",
+       "Wands",
+       "Staffs",
+       "Rods",
+       "Cards",
+       "Capture Balls",
+       "Parchments",
+       "Spikes",
+       "Boxs",
+       "Figurines",
+       "Statues",
+       "Junks",
+       "Bottles",
+       "Skeletons",
+       "Corpses",
+       "Swords",
+       "Blunt Weapons",
+       "Polearms",
+       "Diggers",
+       "Bows",
+       "Shots",
+       "Arrows",
+       "Bolts",
+       "Soft Armor",
+       "Hard Armor",
+       "Dragon Armor",
+       "Shields",
+       "Cloaks",
+       "Gloves",
+       "Helms",
+       "Crowns",
+       "Boots",
+       "Spellbooks",
+       "Treasure",
+       "Something",
+#endif
+       NULL
+};
+
+
+/*
+ * TVALs of items in each group
+ */
+byte object_group_tval[MAX_OBJECT_GROUP_TVAL] =
+{
+       TV_FOOD,
+       TV_POTION,
+       TV_FLASK,
+       TV_SCROLL,
+       TV_RING,
+       TV_AMULET,
+       TV_WHISTLE,
+       TV_LITE,
+       TV_WAND,
+       TV_STAFF,
+       TV_ROD,
+       TV_CARD,
+       TV_CAPTURE,
+       TV_PARCHMENT,
+       TV_SPIKE,
+       TV_CHEST,
+       TV_FIGURINE,
+       TV_STATUE,
+       TV_JUNK,
+       TV_BOTTLE,
+       TV_SKELETON,
+       TV_CORPSE,
+       TV_SWORD,
+       TV_HAFTED,
+       TV_POLEARM,
+       TV_DIGGING,
+       TV_BOW,
+       TV_SHOT,
+       TV_ARROW,
+       TV_BOLT,
+       TV_SOFT_ARMOR,
+       TV_HARD_ARMOR,
+       TV_DRAG_ARMOR,
+       TV_SHIELD,
+       TV_CLOAK,
+       TV_GLOVES,
+       TV_HELM,
+       TV_CROWN,
+       TV_BOOTS,
+       TV_LIFE_BOOK,
+       TV_GOLD,
+       0,
+       0,
+};
diff --git a/src/cmd/object-group-table.h b/src/cmd/object-group-table.h
new file mode 100644 (file)
index 0000000..b5b0ea8
--- /dev/null
@@ -0,0 +1,8 @@
+#pragma once
+
+#define MAX_OBJECT_GROUP_TEXT 43
+#define MAX_OBJECT_GROUP_TVAL 43
+
+extern concptr object_group_text[MAX_OBJECT_GROUP_TEXT];
+extern byte object_group_tval[MAX_OBJECT_GROUP_TVAL];
+