<ClCompile Include="..\..\src\selfinfo.c" />\r
<ClCompile Include="..\..\src\shoot.c" />\r
<ClCompile Include="..\..\src\snipe.c" />\r
+ <ClCompile Include="..\..\src\sort.c" />\r
<ClCompile Include="..\..\src\spells-summon.c" />\r
<ClCompile Include="..\..\src\spells1.c" />\r
<ClCompile Include="..\..\src\spells2.c" />\r
<ClInclude Include="..\..\src\rooms-vault.h" />\r
<ClInclude Include="..\..\src\rooms.h" />\r
<ClInclude Include="..\..\src\selfinfo.h" />\r
+ <ClInclude Include="..\..\src\sort.h" />\r
<ClInclude Include="..\..\src\spells-summon.h" />\r
<ClInclude Include="..\..\src\floor-streams.h" />\r
<ClInclude Include="..\..\src\store.h" />\r
rooms-special.c rooms-special.h rooms-trap.c rooms-trap.h rooms-vault.c \
rooms-vault.h save.c scores.c selfinfo.c selfinfo.h shoot.c snipe.c \
spells1.c spells2.c spells3.c spells-summon.c spells-summon.h \
+ sort.c sort.h \
store.h store.c tables.c trap.c trap.h types.h util.c \
variable.c wild.c wizard1.c wizard2.c \
world.c world.h xtra1.c xtra2.c z-config.h \
#include "monsterrace-hook.h"
#include "melee.h"
#include "world.h"
+#include "sort.h"
/*!
* ループ中で / hack as in leave_store in store.c
#include "cmd-activate.h"
#include "object-hook.h"
#include "spells-summon.h"
+#include "sort.h"
/*!
* @brief ペット入りモンスターボールをソートするための比較関数
#include "cmd-zapwand.h"
#include "object-hook.h"
+#include "sort.h"
/*!
#include "angband.h"
#include "melee.h"
+#include "sort.h"
/*!
* @brief プレイヤーの騎乗/下馬処理判定
#include "cmd-pet.h"
#include "world.h"
#include "player-status.h"
+#include "sort.h"
/*
extern bool change_panel(POSITION dy, POSITION dx);
extern void verify_panel(void);
extern cptr look_mon_desc(monster_type *m_ptr, BIT_FLAGS mode);
-extern void ang_sort_aux(vptr u, vptr v, int p, int q);
-extern void ang_sort(vptr u, vptr v, int n);
extern bool target_able(MONSTER_IDX m_idx);
extern bool target_okay(void);
extern bool target_set(BIT_FLAGS mode);
#include "angband.h"
#include "world.h"
#include "player-status.h"
+#include "sort.h"
/*
#include "rooms.h"\r
#include "rooms-pitnest.h"\r
#include "monsterrace-hook.h"\r
+#include "sort.h"\r
\r
\r
\r
*/
#include "angband.h"
+#include "sort.h"
--- /dev/null
+#include "angband.h"
+#include "sort.h"
+
+
+/*
+ * Angband sorting algorithm -- quick sort in place
+ *
+ * Note that the details of the data we are sorting is hidden,
+ * and we rely on the "ang_sort_comp()" and "ang_sort_swap()"
+ * function hooks to interact with the data, which is given as
+ * two pointers, and which may have any user-defined form.
+ */
+void ang_sort_aux(vptr u, vptr v, int p, int q)
+{
+ int z, a, b;
+
+ /* Done sort */
+ if (p >= q) return;
+
+ /* Pivot */
+ z = p;
+
+ /* Begin */
+ a = p;
+ b = q;
+
+ /* Partition */
+ while (TRUE)
+ {
+ /* Slide i2 */
+ while (!(*ang_sort_comp)(u, v, b, z)) b--;
+
+ /* Slide i1 */
+ while (!(*ang_sort_comp)(u, v, z, a)) a++;
+
+ /* Done partition */
+ if (a >= b) break;
+
+ /* Swap */
+ (*ang_sort_swap)(u, v, a, b);
+
+ /* Advance */
+ a++, b--;
+ }
+
+ /* Recurse left side */
+ ang_sort_aux(u, v, p, b);
+
+ /* Recurse right side */
+ ang_sort_aux(u, v, b + 1, q);
+}
+
+
+/*
+ * Angband sorting algorithm -- quick sort in place
+ *
+ * Note that the details of the data we are sorting is hidden,
+ * and we rely on the "ang_sort_comp()" and "ang_sort_swap()"
+ * function hooks to interact with the data, which is given as
+ * two pointers, and which may have any user-defined form.
+ */
+void ang_sort(vptr u, vptr v, int n)
+{
+ /* Sort the array */
+ ang_sort_aux(u, v, 0, n - 1);
+}
+
+
+
--- /dev/null
+extern void ang_sort_aux(vptr u, vptr v, int p, int q);
+extern void ang_sort(vptr u, vptr v, int n);
+
*/
#include "angband.h"
+#include "sort.h"
#ifdef ALLOW_SPOILERS
#include "object-curse.h"
#include "monsterrace-hook.h"
#include "objectkind-hook.h"
+#include "sort.h"
#define REWARD_CHANCE 10
-/*
- * Angband sorting algorithm -- quick sort in place
- *
- * Note that the details of the data we are sorting is hidden,
- * and we rely on the "ang_sort_comp()" and "ang_sort_swap()"
- * function hooks to interact with the data, which is given as
- * two pointers, and which may have any user-defined form.
- */
-void ang_sort_aux(vptr u, vptr v, int p, int q)
-{
- int z, a, b;
-
- /* Done sort */
- if (p >= q) return;
-
- /* Pivot */
- z = p;
-
- /* Begin */
- a = p;
- b = q;
-
- /* Partition */
- while (TRUE)
- {
- /* Slide i2 */
- while (!(*ang_sort_comp)(u, v, b, z)) b--;
-
- /* Slide i1 */
- while (!(*ang_sort_comp)(u, v, z, a)) a++;
-
- /* Done partition */
- if (a >= b) break;
-
- /* Swap */
- (*ang_sort_swap)(u, v, a, b);
-
- /* Advance */
- a++, b--;
- }
-
- /* Recurse left side */
- ang_sort_aux(u, v, p, b);
-
- /* Recurse right side */
- ang_sort_aux(u, v, b+1, q);
-}
-
-
-/*
- * Angband sorting algorithm -- quick sort in place
- *
- * Note that the details of the data we are sorting is hidden,
- * and we rely on the "ang_sort_comp()" and "ang_sort_swap()"
- * function hooks to interact with the data, which is given as
- * two pointers, and which may have any user-defined form.
- */
-void ang_sort(vptr u, vptr v, int n)
-{
- /* Sort the array */
- ang_sort_aux(u, v, 0, n-1);
-}
-
-
-
/*** Targeting Code ***/