Submodule for JSON added.

Menu data and menu in their own folder.
This commit is contained in:
Pcornat 2022-01-14 22:06:07 +01:00
parent 27c571a6b9
commit 9142896237
Signed by: Pcornat
GPG key ID: 2F3932FF46D9ECA0
12 changed files with 106 additions and 60 deletions

30
include/gui/menu/menu.hpp Normal file
View file

@ -0,0 +1,30 @@
#ifndef BILLYSHEET_MENU_HPP
#define BILLYSHEET_MENU_HPP
#include <spdlog/spdlog.h>
namespace gui {
class GuiData;
namespace menu {
class MenuData;
class Menu final {
private:
MenuData &data;
public:
Menu() noexcept = delete;
explicit Menu(MenuData &data) noexcept: data(data) { SPDLOG_DEBUG("Creating Menu"); }
~Menu() noexcept = default;
void gui() const noexcept;
[[nodiscard]] const MenuData &get_data() const { return data; }
};
}
}
#endif //BILLYSHEET_MENU_HPP

View file

@ -0,0 +1,28 @@
#ifndef BILLYSHEET_MENU_DATA_HPP
#define BILLYSHEET_MENU_DATA_HPP
#include <filesystem>
namespace fs = std::filesystem;
namespace gui::menu {
class MenuData final {
private:
friend class Menu;
fs::path save_path{ "./" };
std::string filename{ "character_sheet.json" };
bool edit_mode{ true };
public:
MenuData() noexcept = default;
~MenuData() noexcept = default;
[[nodiscard]] bool is_edit_mode() const { return edit_mode; }
};
}
#endif //BILLYSHEET_MENU_DATA_HPP