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:
static constexpr const char *const open_character_key{ "CharacterSheetOpen" };
static constexpr const char *const 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
void set_save_path(const fs::path &savePath) const { save_path = savePath; }
void set_filename(const std::string &fileName) const { filename = fileName; }
};
}
#endif //BILLYSHEET_MENU_DATA_HPP