OSDN Git Service

[Refactor] #40413 Separated angband-files.c/h from util.c/h
[hengband/hengband.git] / src / autopick / autopick-util.h
1 #pragma once
2
3 #include "system/angband.h"
4
5 #define MAX_LINELEN 1024
6 #define MAX_AUTOPICK_DEFAULT 200
7 #define MAX_YANK MAX_LINELEN
8 #define MAX_LINES 3000
9
10 #define PT_DEFAULT 0
11 #define PT_WITH_PNAME 1
12
13 #define MARK_MARK     0x01
14 #define MARK_BY_SHIFT 0x02
15
16 #define LSTAT_BYPASS        0x01
17 #define LSTAT_EXPRESSION    0x02
18 #define LSTAT_AUTOREGISTER  0x04
19
20 /*!
21  * @struct autopick_type
22  * @brief 自動拾い/破壊設定データの構造体 / A structure type for entry of auto-picker/destroyer
23  */
24 typedef struct {
25         concptr name;          /*!< 自動拾い/破壊定義の名称一致基準 / Items which have 'name' as part of its name match */
26         concptr insc;          /*!< 対象となったアイテムに自動で刻む内容 / Items will be auto-inscribed as 'insc' */
27         BIT_FLAGS flag[2];       /*!< キーワードに関する汎用的な条件フラグ / Misc. keyword to be matched */
28         byte action;        /*!< 対象のアイテムを拾う/破壊/放置するかの指定フラグ / Auto-pickup or Destroy or Leave items */
29         byte dice;          /*!< 武器のダイス値基準値 / Weapons which have more than 'dice' dice match */
30         byte bonus;         /*!< アイテムのボーナス基準値 / Items which have more than 'bonus' magical bonus match */
31 } autopick_type;
32
33 /*
34  * Struct for yank buffer
35  */
36 typedef struct chain_str {
37         struct chain_str *next;
38         char s[1];
39 } chain_str_type;
40
41 /*
42  * Data struct for text editor
43  */
44 typedef struct {
45         int wid, hgt;
46         int cx, cy;
47         int upper, left;
48         int old_wid, old_hgt;
49         int old_cy;
50         int old_upper, old_left;
51         int mx, my;
52         byte mark;
53
54         object_type *search_o_ptr;
55         concptr search_str;
56         concptr last_destroyed;
57
58         chain_str_type *yank;
59         bool yank_eol;
60
61         concptr *lines_list;
62         byte states[MAX_LINES];
63
64         u16b dirty_flags;
65         int dirty_line;
66         int filename_mode;
67         int old_com_id;
68
69         bool changed;
70 } text_body_type;
71
72 /*
73  *  List for auto-picker/destroyer entries
74  */
75 extern int max_autopick;
76 extern int max_max_autopick;
77 extern autopick_type *autopick_list;
78 extern object_type autopick_last_destroyed_object;
79
80 void autopick_free_entry(autopick_type *entry);
81 void free_text_lines(concptr *lines_list);
82 int get_com_id(char key);
83 void auto_inscribe_item(player_type *player_ptr, object_type *o_ptr, int idx);
84 void add_autopick_list(autopick_type *entry);