From dd22e1ab7ab7b5bac841dae2b62bfa200b36c4d8 Mon Sep 17 00:00:00 2001 From: Hannes Schulze Date: Wed, 12 Feb 2025 23:57:32 +0100 Subject: add encryption/decryption --- lib/nes/app/action.hh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'lib/nes/app/action.hh') 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_; } -- cgit v1.3.1