diff options
| author | Hannes Schulze <haschu0103@outlook.de> | 2025-02-12 23:57:32 +0100 |
|---|---|---|
| committer | Hannes Schulze <haschu0103@outlook.de> | 2025-02-12 23:57:32 +0100 |
| commit | dd22e1ab7ab7b5bac841dae2b62bfa200b36c4d8 (patch) | |
| tree | 900781940d2ed92df1d87cc7dd6209853492e07f /lib/nes/app/action.hh | |
| parent | 0de4957a22dd408793d0526351bcb7d61786fe86 (diff) | |
add encryption/decryption
Diffstat (limited to 'lib/nes/app/action.hh')
| -rw-r--r-- | lib/nes/app/action.hh | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/nes/app/action.hh b/lib/nes/app/action.hh index ed879f3..c88a5f1 100644 --- a/lib/nes/app/action.hh +++ b/lib/nes/app/action.hh @@ -21,11 +21,13 @@ namespace nes::app confirm_quit, launch_game, show_error, + prompt_key, }; private: type type_{ type::none }; string_view file_name_; + string_view key_; string_view message_; status error_{ status::success }; @@ -40,10 +42,11 @@ namespace nes::app static auto cancel_quit() -> action { return action{ type::cancel_quit }; } static auto confirm_quit() -> action { return action{ type::confirm_quit }; } - static auto launch_game(string_view const file_name) -> action + static auto launch_game(string_view const file_name, string_view const key = "") -> action { auto res = action{ type::launch_game }; res.file_name_ = file_name; + res.key_ = key; return res; } @@ -55,8 +58,16 @@ namespace nes::app return res; } + static auto prompt_key(string_view const file_name) -> action + { + auto res = action{ type::prompt_key }; + res.file_name_ = file_name; + return res; + } + auto get_type() const -> type { return type_; } auto get_file_name() const -> string_view { return file_name_; } + auto get_key() const -> string_view { return key_; } auto get_message() const -> string_view { return message_; } auto get_error() const -> status { return error_; } |
