Reformat.
This commit is contained in:
parent
7d1a0473ff
commit
2755f4827e
24 changed files with 6140 additions and 5829 deletions
|
@ -10,49 +10,49 @@ class Controller;
|
|||
|
||||
namespace gui {
|
||||
|
||||
class GuiData;
|
||||
class GuiData;
|
||||
|
||||
class Window;
|
||||
class Window;
|
||||
|
||||
namespace menu { class MenuData; }
|
||||
namespace menu { class MenuData; }
|
||||
|
||||
class Gui final {
|
||||
private:
|
||||
GuiData &data;
|
||||
class Gui final {
|
||||
private:
|
||||
GuiData &data;
|
||||
|
||||
menu::Menu menu;
|
||||
menu::Menu menu;
|
||||
|
||||
const fs::path font;
|
||||
const fs::path font;
|
||||
|
||||
bool initialized{ false };
|
||||
bool initialized{ false };
|
||||
|
||||
void habilete_menu() noexcept;
|
||||
void habilete_menu() noexcept;
|
||||
|
||||
void adresse_menu() noexcept;
|
||||
void adresse_menu() noexcept;
|
||||
|
||||
void endurance_menu() noexcept;
|
||||
void endurance_menu() noexcept;
|
||||
|
||||
void chance_menu() noexcept;
|
||||
void chance_menu() noexcept;
|
||||
|
||||
void stat_second_menu() noexcept;
|
||||
void stat_second_menu() noexcept;
|
||||
|
||||
void materiel_menu() noexcept;
|
||||
void materiel_menu() noexcept;
|
||||
|
||||
void gloire_menu() noexcept;
|
||||
void gloire_menu() noexcept;
|
||||
|
||||
void richesse_menu() noexcept;
|
||||
void richesse_menu() noexcept;
|
||||
|
||||
public:
|
||||
Gui() = delete;
|
||||
public:
|
||||
Gui() = delete;
|
||||
|
||||
explicit Gui(Window &window, GuiData &data, menu::MenuData &menuData);
|
||||
explicit Gui(Window &window, GuiData &data, menu::MenuData &menuData);
|
||||
|
||||
~Gui() noexcept;
|
||||
~Gui() noexcept;
|
||||
|
||||
void render_gui(const Controller &controller);
|
||||
void render_gui(const Controller &controller);
|
||||
|
||||
void render_gpu() const;
|
||||
};
|
||||
void render_gpu() const;
|
||||
};
|
||||
}
|
||||
|
||||
#endif //BILLYSHEET_GUI_HPP
|
||||
|
|
|
@ -5,57 +5,57 @@
|
|||
#include <spdlog/spdlog.h>
|
||||
|
||||
namespace character {
|
||||
class CharacterSheet;
|
||||
class CharacterSheet;
|
||||
}
|
||||
|
||||
using namespace std::string_view_literals;
|
||||
|
||||
namespace gui {
|
||||
|
||||
enum class characChanged {
|
||||
None,
|
||||
Adresse,
|
||||
Endurance,
|
||||
Chance,
|
||||
Habilete
|
||||
};
|
||||
enum class characChanged {
|
||||
None,
|
||||
Adresse,
|
||||
Endurance,
|
||||
Chance,
|
||||
Habilete
|
||||
};
|
||||
|
||||
class GuiData final {
|
||||
private:
|
||||
friend class Gui;
|
||||
class GuiData final {
|
||||
private:
|
||||
friend class Gui;
|
||||
|
||||
character::CharacterSheet &billy;
|
||||
character::CharacterSheet &billy;
|
||||
|
||||
std::pair<characChanged, std::uint32_t> base{ characChanged::None, 0 };
|
||||
std::pair<characChanged, std::uint32_t> base{ characChanged::None, 0 };
|
||||
|
||||
std::pair<characChanged, std::uint32_t> carac{ characChanged::None, 0 };
|
||||
std::pair<characChanged, std::uint32_t> carac{ characChanged::None, 0 };
|
||||
|
||||
std::pair<characChanged, std::uint32_t> materiel{ characChanged::None, 0 };
|
||||
std::pair<characChanged, std::uint32_t> materiel{ characChanged::None, 0 };
|
||||
|
||||
std::pair<characChanged, std::uint32_t> additional{ characChanged::None, 0 };
|
||||
std::pair<characChanged, std::uint32_t> additional{ characChanged::None, 0 };
|
||||
|
||||
public:
|
||||
static constexpr std::array classes{
|
||||
"Guerrier"sv,
|
||||
"Prudent"sv,
|
||||
"Paysan"sv,
|
||||
"Débrouillard"sv
|
||||
};
|
||||
public:
|
||||
static constexpr std::array classes{
|
||||
"Guerrier"sv,
|
||||
"Prudent"sv,
|
||||
"Paysan"sv,
|
||||
"Débrouillard"sv
|
||||
};
|
||||
|
||||
GuiData() = delete;
|
||||
GuiData() = delete;
|
||||
|
||||
explicit GuiData(character::CharacterSheet &billy) noexcept: billy(billy) { SPDLOG_DEBUG("Creating GUI Data"); }
|
||||
explicit GuiData(character::CharacterSheet &billy) noexcept: billy(billy) { SPDLOG_DEBUG("Creating GUI Data"); }
|
||||
|
||||
~GuiData() noexcept = default;
|
||||
~GuiData() noexcept = default;
|
||||
|
||||
[[nodiscard]] const std::pair<characChanged, std::uint32_t> &get_base() const { return base; }
|
||||
[[nodiscard]] const std::pair<characChanged, std::uint32_t> &get_base() const { return base; }
|
||||
|
||||
[[nodiscard]] const std::pair<characChanged, std::uint32_t> &get_carac() const { return carac; }
|
||||
[[nodiscard]] const std::pair<characChanged, std::uint32_t> &get_carac() const { return carac; }
|
||||
|
||||
[[nodiscard]] const std::pair<characChanged, std::uint32_t> &get_materiel() const { return materiel; }
|
||||
[[nodiscard]] const std::pair<characChanged, std::uint32_t> &get_materiel() const { return materiel; }
|
||||
|
||||
[[nodiscard]] const std::pair<characChanged, std::uint32_t> &get_additional() const { return additional; }
|
||||
};
|
||||
[[nodiscard]] const std::pair<characChanged, std::uint32_t> &get_additional() const { return additional; }
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -4,26 +4,26 @@
|
|||
#include <spdlog/spdlog.h>
|
||||
|
||||
namespace gui {
|
||||
class GuiData;
|
||||
class GuiData;
|
||||
|
||||
namespace menu {
|
||||
class MenuData;
|
||||
namespace menu {
|
||||
class MenuData;
|
||||
|
||||
class Menu final {
|
||||
private:
|
||||
MenuData &data;
|
||||
public:
|
||||
Menu() noexcept = delete;
|
||||
class Menu final {
|
||||
private:
|
||||
MenuData &data;
|
||||
public:
|
||||
Menu() noexcept = delete;
|
||||
|
||||
explicit Menu(MenuData &data) noexcept;
|
||||
explicit Menu(MenuData &data) noexcept;
|
||||
|
||||
~Menu() noexcept = default;
|
||||
~Menu() noexcept = default;
|
||||
|
||||
void gui() const noexcept;
|
||||
void gui() const noexcept;
|
||||
|
||||
[[nodiscard]] const MenuData &get_data() const { return data; }
|
||||
};
|
||||
}
|
||||
[[nodiscard]] const MenuData &get_data() const { return data; }
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -8,38 +8,40 @@ namespace fs = std::filesystem;
|
|||
class Controller;
|
||||
|
||||
namespace character {
|
||||
class CharacterSheet;
|
||||
class CharacterSheet;
|
||||
}
|
||||
|
||||
namespace gui::menu {
|
||||
class MenuData final {
|
||||
public:
|
||||
const std::string open_character_key{ "CharacterSheetOpen" };
|
||||
class MenuData final {
|
||||
public:
|
||||
const std::string open_character_key{ "CharacterSheetOpen" };
|
||||
|
||||
const std::string save_character_key{ "CharacterSheetSaveAs" };
|
||||
private:
|
||||
friend class Menu;
|
||||
const std::string save_character_key{ "CharacterSheetSaveAs" };
|
||||
private:
|
||||
friend class Menu;
|
||||
|
||||
const character::CharacterSheet &character_sheet;
|
||||
const character::CharacterSheet &character_sheet;
|
||||
|
||||
mutable fs::path save_path{ "./" };
|
||||
mutable fs::path save_path{ "./" };
|
||||
|
||||
mutable std::string filename{ "character_sheet.json" };
|
||||
mutable std::string filename{ "character_sheet.json" };
|
||||
|
||||
bool edit_mode{ true };
|
||||
public:
|
||||
MenuData() noexcept = delete;
|
||||
bool edit_mode{ true };
|
||||
public:
|
||||
MenuData() noexcept = delete;
|
||||
|
||||
explicit MenuData(const character::CharacterSheet &characterSheet) noexcept: character_sheet(characterSheet) {}
|
||||
explicit MenuData(const character::CharacterSheet &characterSheet) noexcept: character_sheet(characterSheet) {}
|
||||
|
||||
~MenuData() noexcept = default;
|
||||
~MenuData() noexcept = default;
|
||||
|
||||
[[nodiscard]] bool is_edit_mode() const { return edit_mode; }
|
||||
[[nodiscard]] bool is_edit_mode() const { return edit_mode; }
|
||||
|
||||
void set_save_path([[maybe_unused]] const Controller &controller, const fs::path &savePath) const { save_path = savePath; }
|
||||
void set_save_path([[maybe_unused]] const Controller &controller,
|
||||
const fs::path &savePath) const { save_path = savePath; }
|
||||
|
||||
void set_filename([[maybe_unused]] const Controller &controller, const std::string &fileName) const { filename = fileName; }
|
||||
};
|
||||
void set_filename([[maybe_unused]] const Controller &controller,
|
||||
const std::string &fileName) const { filename = fileName; }
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -7,28 +7,29 @@
|
|||
#include <memory>
|
||||
|
||||
namespace gui {
|
||||
class Window final {
|
||||
private:
|
||||
static void delete_glfw_window(GLFWwindow *glfWwindow) {
|
||||
glfwDestroyWindow(glfWwindow);
|
||||
glfwTerminate();
|
||||
}
|
||||
class Window final {
|
||||
private:
|
||||
static void delete_glfw_window(GLFWwindow *glfWwindow) {
|
||||
glfwDestroyWindow(glfWwindow);
|
||||
glfwTerminate();
|
||||
}
|
||||
|
||||
std::unique_ptr<GLFWwindow, decltype(&delete_glfw_window)> wwindow{ nullptr, delete_glfw_window };
|
||||
std::unique_ptr<GLFWwindow, decltype(&delete_glfw_window)> wwindow{ nullptr, delete_glfw_window };
|
||||
|
||||
public:
|
||||
Window();
|
||||
public:
|
||||
Window();
|
||||
|
||||
Window(Window &&window) noexcept: wwindow(std::move(window.wwindow)) {}
|
||||
Window(Window &&window) noexcept: wwindow(std::move(window.wwindow)) {}
|
||||
|
||||
~Window() noexcept = default;
|
||||
~Window() noexcept = default;
|
||||
|
||||
[[nodiscard]] const std::unique_ptr<GLFWwindow, decltype(&delete_glfw_window)> &get_window() const { return wwindow; }
|
||||
[[nodiscard]] const std::unique_ptr<GLFWwindow, decltype(&delete_glfw_window)> &
|
||||
get_window() const { return wwindow; }
|
||||
|
||||
[[nodiscard]] bool should_close() const noexcept;
|
||||
[[nodiscard]] bool should_close() const noexcept;
|
||||
|
||||
void swap_buffers() const noexcept;
|
||||
};
|
||||
void swap_buffers() const noexcept;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue