diff --git a/CMakeLists.txt b/CMakeLists.txt index 768a0aa..7617d4e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,7 +21,13 @@ set(SOURCE_HEADERS include/imgui/imstb_truetype.h include/gui.hpp include/gui_data.hpp - include/window.hpp) + include/window.hpp + include/billy_sheet.hpp + include/characteristic/habilete.hpp + include/characteristic/adresse.hpp + include/characteristic/endurance.hpp + include/characteristic/chance.hpp + ) set(SOURCE_FILES src/imgui/imgui.cpp @@ -33,7 +39,12 @@ set(SOURCE_FILES src/main.cpp src/gui.cpp src/gui_data.cpp - src/window.cpp) + src/window.cpp + src/billy_sheet.cpp + src/characteristic/adresse.cpp + src/characteristic/endurance.cpp + src/characteristic/chance.cpp + ) set(SOURCES ${SOURCE_HEADERS} @@ -75,7 +86,7 @@ set(COMPILE_FLAGS -Wall -Wextra -Wpedantic - -Wpadded + # -Wpadded -pedantic -ffunction-sections -fdata-sections diff --git a/include/billy_sheet.hpp b/include/billy_sheet.hpp new file mode 100644 index 0000000..da15641 --- /dev/null +++ b/include/billy_sheet.hpp @@ -0,0 +1,16 @@ +#ifndef BILLYSHEET_BILLY_SHEET_HPP +#define BILLYSHEET_BILLY_SHEET_HPP + +#include + +namespace character { + class BillySheet { + private: + std::mt19937_64 engine{ std::random_device{ "rdseed" }() }; + + std::string caractere{}; + }; +} + + +#endif //BILLYSHEET_BILLY_SHEET_HPP diff --git a/include/characteristic/adresse.hpp b/include/characteristic/adresse.hpp new file mode 100644 index 0000000..a30f6d8 --- /dev/null +++ b/include/characteristic/adresse.hpp @@ -0,0 +1,17 @@ +#ifndef BILLYSHEET_ADRESSE_HPP +#define BILLYSHEET_ADRESSE_HPP + +#include + +namespace character::characteristic { + class Adresse { + private: + const std::uint32_t base{ 1 }; + std::uint32_t carac{ 0 }; + std::uint32_t materiel{ 0 }; + std::uint32_t additional{ 0 }; + }; +} + + +#endif //BILLYSHEET_ADRESSE_HPP diff --git a/include/characteristic/chance.hpp b/include/characteristic/chance.hpp new file mode 100644 index 0000000..5ea3df5 --- /dev/null +++ b/include/characteristic/chance.hpp @@ -0,0 +1,17 @@ +#ifndef BILLYSHEET_CHANCE_HPP +#define BILLYSHEET_CHANCE_HPP + +#include + +namespace character::characteristic { + class Chance { + private: + const std::uint32_t base{ 3 }; + std::uint32_t carac{ 0 }; + std::uint32_t materiel{ 0 }; + std::uint32_t additional{ 0 }; + }; +} + + +#endif //BILLYSHEET_CHANCE_HPP diff --git a/include/characteristic/endurance.hpp b/include/characteristic/endurance.hpp new file mode 100644 index 0000000..9f75b20 --- /dev/null +++ b/include/characteristic/endurance.hpp @@ -0,0 +1,21 @@ +// +// Created by postaron on 10/01/2022. +// + +#ifndef BILLYSHEET_ENDURANCE_HPP +#define BILLYSHEET_ENDURANCE_HPP + +#include + +namespace character::characteristic { + class Endurance { + private: + const std::uint32_t base{ 2 }; + std::uint32_t carac{ 0 }; + std::uint32_t materiel{ 0 }; + std::uint32_t additional{ 0 }; + }; +} + + +#endif //BILLYSHEET_ENDURANCE_HPP diff --git a/include/characteristic/habilete.hpp b/include/characteristic/habilete.hpp new file mode 100644 index 0000000..fc93a1f --- /dev/null +++ b/include/characteristic/habilete.hpp @@ -0,0 +1,17 @@ +#ifndef BILLYSHEET_HABILETE_HPP +#define BILLYSHEET_HABILETE_HPP + +#include + +namespace character::characteristic { + class Habilete final { + private: + const std::uint32_t base{ 2 }; + std::uint32_t carac{ 0 }; + std::uint32_t materiel{ 0 }; + std::uint32_t additional{ 0 }; + }; +} + + +#endif //BILLYSHEET_HABILETE_HPP diff --git a/include/gui_data.hpp b/include/gui_data.hpp index 6721bb5..9364954 100644 --- a/include/gui_data.hpp +++ b/include/gui_data.hpp @@ -1,6 +1,8 @@ #ifndef BILLYSHEET_GUI_DATA_HPP #define BILLYSHEET_GUI_DATA_HPP +#include "billy_sheet.hpp" +#include namespace gui { class Window; @@ -9,10 +11,12 @@ namespace gui { private: Window &window; + character::BillySheet billy; + public: GuiData() = delete; - explicit GuiData(Window &wwindow) : window(wwindow) {} + explicit GuiData(Window &wwindow) : window(wwindow) { SPDLOG_DEBUG("Creating GUI Data"); } [[nodiscard]] Window &get_window() const; diff --git a/src/billy_sheet.cpp b/src/billy_sheet.cpp new file mode 100644 index 0000000..1bdb957 --- /dev/null +++ b/src/billy_sheet.cpp @@ -0,0 +1 @@ +#include "billy_sheet.hpp" diff --git a/src/characteristic/adresse.cpp b/src/characteristic/adresse.cpp new file mode 100644 index 0000000..6cbafc8 --- /dev/null +++ b/src/characteristic/adresse.cpp @@ -0,0 +1,5 @@ +// +// Created by postaron on 10/01/2022. +// + +#include "characteristic/adresse.hpp" diff --git a/src/characteristic/chance.cpp b/src/characteristic/chance.cpp new file mode 100644 index 0000000..e4655f8 --- /dev/null +++ b/src/characteristic/chance.cpp @@ -0,0 +1,5 @@ +// +// Created by postaron on 10/01/2022. +// + +#include "characteristic/chance.hpp" diff --git a/src/characteristic/endurance.cpp b/src/characteristic/endurance.cpp new file mode 100644 index 0000000..a7002b0 --- /dev/null +++ b/src/characteristic/endurance.cpp @@ -0,0 +1 @@ +#include "characteristic/endurance.hpp" diff --git a/src/gui.cpp b/src/gui.cpp index d969524..005948a 100644 --- a/src/gui.cpp +++ b/src/gui.cpp @@ -7,11 +7,13 @@ #include "window.hpp" gui::Gui::Gui(gui::GuiData &data) : data(data), font("font/DejaVuSans.ttf") { + SPDLOG_DEBUG("Creating GUI"); ImGui::CreateContext(); ImGui::StyleColorsDark(); ImGui::GetIO().Fonts->AddFontFromFileTTF(font.c_str(), 18.0f); ImGui_ImplGlfw_InitForOpenGL(data.get_window().get_window().get(), true); initialized = ImGui_ImplOpenGL3_Init(); + SPDLOG_DEBUG("Initialized: {}", initialized); } gui::Gui::~Gui() noexcept { diff --git a/src/main.cpp b/src/main.cpp index 7782843..d0c0988 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -7,12 +7,10 @@ int main() { std::ios::sync_with_stdio(false); spdlog::set_default_logger(spdlog::stdout_color_st("console")); - SPDLOG_DEBUG("Creating Window"); - - gui::Window window; - gui::GuiData gui_data(window); try { + gui::Window window; + gui::GuiData gui_data(window); gui::Gui gui(gui_data); while (!window.should_close()) { diff --git a/src/window.cpp b/src/window.cpp index 86ebcca..9e994a5 100644 --- a/src/window.cpp +++ b/src/window.cpp @@ -11,6 +11,7 @@ static void framebufferCallback([[maybe_unused]] GLFWwindow *glfWwindow, int wid } gui::Window::Window() { + SPDLOG_DEBUG("Creating Window"); glfwSetErrorCallback(glfwErrorCallback); if (glfwInit() == GLFW_FALSE) { SPDLOG_CRITICAL("GLFW init failed.");