BillySheet/include/gui/menu/menu_data.hpp

49 lines
1.3 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 {
2024-01-28 20:31:50 +01:00
class CharacterSheet;
}
namespace gui::menu {
2024-01-28 20:31:50 +01:00
class MenuData final {
public:
const std::string open_character_key{ "CharacterSheetOpen" };
2022-01-17 23:36:12 +01:00
2024-01-28 20:31:50 +01:00
const std::string save_character_key{ "CharacterSheetSaveAs" };
private:
friend class Menu;
2024-01-28 20:31:50 +01:00
const character::CharacterSheet &character_sheet;
2024-01-28 20:31:50 +01:00
mutable fs::path save_path{ "./" };
2024-01-28 20:31:50 +01:00
mutable std::string filename{ "character_sheet.json" };
2024-01-28 20:31:50 +01:00
bool edit_mode{ true };
public:
MenuData() noexcept = delete;
2024-01-28 20:31:50 +01:00
explicit MenuData(const character::CharacterSheet &characterSheet) noexcept: character_sheet(characterSheet) {}
2024-01-28 20:31:50 +01:00
~MenuData() noexcept = default;
2024-01-28 20:31:50 +01:00
[[nodiscard]] bool is_edit_mode() const { return edit_mode; }
2022-01-17 23:36:12 +01:00
2024-01-28 20:31:50 +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
2024-01-28 20:31:50 +01:00
void set_filename([[maybe_unused]] const Controller &controller,
const std::string &fileName) const { filename = fileName; }
};
}
#endif //BILLYSHEET_MENU_DATA_HPP