Submodule for JSON added.
Menu data and menu in their own folder.
This commit is contained in:
parent
27c571a6b9
commit
9142896237
12 changed files with 106 additions and 60 deletions
30
include/gui/menu/menu.hpp
Normal file
30
include/gui/menu/menu.hpp
Normal 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
|
28
include/gui/menu/menu_data.hpp
Normal file
28
include/gui/menu/menu_data.hpp
Normal 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
|
Loading…
Add table
Add a link
Reference in a new issue