2022-01-14 22:06:07 +01:00
|
|
|
#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;
|
|
|
|
|
2022-01-17 22:00:26 +01:00
|
|
|
namespace character {
|
|
|
|
class CharacterSheet;
|
|
|
|
}
|
|
|
|
|
2022-01-14 22:06:07 +01:00
|
|
|
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" };
|
2022-01-14 22:06:07 +01:00
|
|
|
private:
|
|
|
|
friend class Menu;
|
|
|
|
|
2022-01-17 22:00:26 +01:00
|
|
|
const character::CharacterSheet &character_sheet;
|
|
|
|
|
2022-01-17 23:36:12 +01:00
|
|
|
mutable fs::path save_path{ "./" };
|
2022-01-14 22:06:07 +01:00
|
|
|
|
2022-01-17 23:36:12 +01:00
|
|
|
mutable std::string filename{ "character_sheet.json" };
|
2022-01-14 22:06:07 +01:00
|
|
|
|
|
|
|
bool edit_mode{ true };
|
|
|
|
public:
|
2022-01-17 22:00:26 +01:00
|
|
|
MenuData() noexcept = delete;
|
|
|
|
|
|
|
|
explicit MenuData(const character::CharacterSheet &characterSheet) noexcept: character_sheet(characterSheet) {}
|
2022-01-14 22:06:07 +01:00
|
|
|
|
|
|
|
~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; }
|
2022-01-14 22:06:07 +01:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endif //BILLYSHEET_MENU_DATA_HPP
|