BillySheet/include/gui/menu/menu_data.hpp

47 lines
1.1 KiB
C++
Raw Normal View History

#ifndef BILLYSHEET_MENU_DATA_HPP
#define BILLYSHEET_MENU_DATA_HPP
#include <filesystem>
namespace fs = std::filesystem;
2022-01-17 23:36:12 +01:00
class Controller;
namespace character {
class CharacterSheet;
}
namespace gui::menu {
class MenuData final {
2022-01-17 23:36:12 +01:00
public:
2022-01-20 22:30:14 +01:00
const std::string open_character_key{ "CharacterSheetOpen" };
2022-01-17 23:36:12 +01:00
2022-01-20 22:30:14 +01:00
const std::string save_character_key{ "CharacterSheetSaveAs" };
private:
friend class Menu;
const character::CharacterSheet &character_sheet;
2022-01-17 23:36:12 +01:00
mutable fs::path save_path{ "./" };
2022-01-17 23:36:12 +01:00
mutable std::string filename{ "character_sheet.json" };
bool edit_mode{ true };
public:
MenuData() noexcept = delete;
explicit MenuData(const character::CharacterSheet &characterSheet) noexcept: character_sheet(characterSheet) {}
~MenuData() noexcept = default;
[[nodiscard]] bool is_edit_mode() const { return edit_mode; }
2022-01-17 23:36:12 +01:00
2022-01-20 23:16:51 +01:00
void set_save_path([[maybe_unused]] const Controller &controller, const fs::path &savePath) const { save_path = savePath; }
2022-01-17 23:36:12 +01:00
2022-01-20 23:16:51 +01:00
void set_filename([[maybe_unused]] const Controller &controller, const std::string &fileName) const { filename = fileName; }
};
}
#endif //BILLYSHEET_MENU_DATA_HPP