From 93005494ebe97138b493017d372e11c6449102c5 Mon Sep 17 00:00:00 2001 From: chris bell Date: Fri, 31 Jul 2026 11:00:12 -0500 Subject: [PATCH] adding sqlite and trying to define the data structure --- CMakeLists.txt | 4 +++ assets/test.db | Bin 0 -> 12288 bytes flake.nix | 16 +++++----- result | 2 +- src/SzData.hpp | 4 ++- src/main.cpp | 2 +- szds.md | 79 +++++++++++++++++++++++++++++++++++++++++++++++-- 7 files changed, 95 insertions(+), 12 deletions(-) create mode 100644 assets/test.db diff --git a/CMakeLists.txt b/CMakeLists.txt index 669068a..14b1eda 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,6 +16,9 @@ add_library(lunasvg::lunasvg ALIAS PkgConfig::LUNASVG) find_package(RmlUi CONFIG REQUIRED) +pkg_check_modules(SQLITE3 REQUIRED IMPORTED_TARGET sqlite3) +add_library(sqlite3::sqlite3 ALIAS PkgConfig::SQLITE3) + add_library(rmlui_backend STATIC vendor/rmlui_backend/RmlUi_Backend_GLFW_GL3.cpp vendor/rmlui_backend/RmlUi_Platform_GLFW.cpp @@ -51,6 +54,7 @@ target_link_libraries(${PROJECT_NAME} PRIVATE Freetype::Freetype lunasvg::lunasvg glfw + sqlite3::sqlite3 ) install(TARGETS ${PROJECT_NAME} DESTINATION bin) diff --git a/assets/test.db b/assets/test.db new file mode 100644 index 0000000000000000000000000000000000000000..a82527c3c9eb5a0ab1c64e87ef552cee61f1d5a7 GIT binary patch literal 12288 zcmWFz^vNtqRY=P(%1ta$FlG>7U}R))P*7lCU|?imU|?oI01%%A!3E1Baj`NP8T5L8 z@$&y*VB+s$;P2u;k5$#E;AjYphQMeDjE2By2#kinXb6mkz-S1JhQMeDjE2By2#lBz zaAsr^7Zqj9E=f$vNi9h&E&*XC=O923KZ^LRn%_azFn4p7kY zf(QW+F^We+U^E0qLtr!nMnhmU1V%$(Gz3ONU^E0qLtr!nMnhmU1cqw}aDhBF+W!ZI q!YCdMfzc2c4S~@R7!85Z5Eu=C(GVC7fzc2c4S~@R7!8488v+1*AuZAX literal 0 HcmV?d00001 diff --git a/flake.nix b/flake.nix index 76fc6fd..52370d1 100644 --- a/flake.nix +++ b/flake.nix @@ -1,5 +1,5 @@ { - description = "C++ RmlUI + Raylib development environemt"; + description = "sessionzero dev env"; inputs = { nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; @@ -47,15 +47,19 @@ cmake pkg-config gcc + + sqlite + clang-tools lua-language-server + superhtml + vscode-css-languageserver ]; runtimeDeps = with pkgs; [ raylib glfw libGL - clang-tools libX11 libXcursor libXrandr @@ -67,9 +71,7 @@ freetype lunasvg lua - lua-language-server - superhtml - vscode-css-languageserver + sqlite.dev ]; in { @@ -78,8 +80,8 @@ buildInputs = runtimeDeps; shellHook = '' - export CP_PATH="${pkgs.raylib}/include:${pkgs.glfw}/include:${rmlui}/include" - export LIBRARY_PATH="${pkgs.raylib}/lib:${pkgs.glfw}/lib:${pkgs.libGL}/lib:${rmlui}/lib" + export CP_PATH="${pkgs.raylib}/include:${pkgs.glfw}/include:${rmlui}/include:${pkgs.sqlite}/include" + export LIBRARY_PATH="${pkgs.raylib}/lib:${pkgs.glfw}/lib:${pkgs.libGL}/lib:${rmlui}/lib:${pkgs.sqlite}/lib" export LD_LIBRARY_PATH="$LIBRARY_PATH:$LD_LIBRARY_PATH" echo "Env ready" diff --git a/result b/result index b651164..f4aea6c 120000 --- a/result +++ b/result @@ -1 +1 @@ -/nix/store/qz2y746iqyp2k1baskbnhwklp3358gwd-sessionzero-0.1.0 \ No newline at end of file +/nix/store/27xkf4w4r5lwx9bmh43s76pl1izmdmvl-sessionzero-0.1.0 \ No newline at end of file diff --git a/src/SzData.hpp b/src/SzData.hpp index 8cf85dc..66d374f 100644 --- a/src/SzData.hpp +++ b/src/SzData.hpp @@ -18,4 +18,6 @@ public: string Description = ""; // optional std::vector CompatibleSystems; // requires at least one value }; -}; \ No newline at end of file + + +}; diff --git a/src/main.cpp b/src/main.cpp index 712380e..ed17147 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -5,7 +5,6 @@ #include #include #include -#include #include #include #include @@ -15,6 +14,7 @@ #include "element_registry.hpp" #include "ButtonClickListener.hpp" #include "lui_app_api.hpp" +#include static bool is_initalized = false; static bool is_running = false; diff --git a/szds.md b/szds.md index b0e4046..d366769 100644 --- a/szds.md +++ b/szds.md @@ -1,7 +1,80 @@ # SessionZero Data System -```c + + +```text + +sessionzero/ +├─ data/ +│ ├─ datasets/ +│ │ ├─ author.dataset_name/ +│ │ │ ├─ objects/ +│ │ │ │ ├─ item/ +│ │ │ │ │ ├─ stick.szdo +│ │ │ │ ├─ npc/ +│ │ │ │ │ ├─ marcus.szdo +│ │ │ ├─ templates/ +│ │ │ │ ├─ item.szdt +│ │ │ │ ├─ npc.szdt +│ │ │ ├─ dataset.sz +│ │ │ ├─ icon.png +│ ├─ sessions/ +│ │ ├─ author.session_name/ +│ │ │ ├─ players/ +│ │ │ │ ├─ player1/ +│ │ │ │ │ ├─ characters/ +│ │ │ │ │ │ ├─ thumbs/ +│ │ │ │ │ │ │ ├─ character1.png +│ │ │ │ │ │ ├─ character1.szco +│ │ │ │ │ ├─ playerinfo.sz +│ │ │ ├─ character_template.szct +│ │ │ ├─ session.sz +│ ├─ local.db +├─ config.ini +├─ sessionzero + + +``` + + + + + + + + + + + + + + + +Psuedocode for the various data elements and how they connect: + + + + + + + + + + + + + + + + + + + + + + +```text Dataset: { Metadata: { ID (required unique string), @@ -20,7 +93,9 @@ Dataset: { DataType (required string) }, TemplateFields: { - FieldType, + ID (required unique string), + FieldType, + } },