OSDN Git Service

[Refactor] #2138 Separated confirm_command() from request_command()
[hengbandforosx/hengbandosx.git] / src / io / input-key-requester.h
1 #pragma once
2
3 #include "system/angband.h"
4 #include "game-option/keymap-directory-getter.h"
5
6 extern concptr keymap_act[KEYMAP_MODES][256];
7
8 extern bool use_menu;
9
10 extern COMMAND_CODE command_cmd;
11 extern COMMAND_ARG command_arg;
12 extern short command_rep;
13 extern DIRECTION command_dir;
14 extern int16_t command_see;
15 extern TERM_LEN command_gap;
16 extern int16_t command_wrk;
17 extern int16_t command_new;
18
19 class ObjectType;
20 class PlayerType;
21 class InputKeyRequestor {
22 public:
23     InputKeyRequestor(PlayerType *player_ptr, bool shopping);
24     void request_command();
25
26 private:
27     PlayerType *player_ptr;
28     bool shopping;
29     char request_command_buffer[256]{}; /*!< Special buffer to hold the action of the current keymap */
30     keymap_mode mode;
31
32     void input_command();
33     short get_command();
34     char inkey_from_menu();
35     bool process_repeat_num(short *cmd);
36     char input_repeat_num();
37     void process_command_command(short *cmd);
38     void process_control_command(short *cmd);
39     void change_shopping_command();
40     int get_caret_command();
41     void confirm_command(ObjectType &o_ref, const int caret_command);
42 };