diff --git a/src/content/content.hpp b/src/content/content.hpp index 2c371cf..ed59887 100644 --- a/src/content/content.hpp +++ b/src/content/content.hpp @@ -9,11 +9,21 @@ #include -enum class Content1 : uint32_t {}; -using ContentRegistry = entt::basic_registry; +enum class Content : uint32_t {}; +using ContentRegistry = entt::basic_registry; using ContentHandle = entt::basic_handle; -namespace Content::Components { +struct ContentStore { + static constexpr const char* version {"1"}; + + ContentRegistry _reg; + + ContentRegistry& registry(void); + ContentHandle objectHandle(const Content e); + +}; + +namespace Content1::Components { // TODO: design it as a tree? diff --git a/src/main_screen.cpp b/src/main_screen.cpp index 798d239..3446f88 100644 --- a/src/main_screen.cpp +++ b/src/main_screen.cpp @@ -65,6 +65,8 @@ MainScreen::MainScreen(SDL_Renderer* renderer_, Theme& theme_, std::string save_ g_provideInstance("RegistryMessageModel", "host", &rmm); g_provideInstance("MessageSerializerNJ", "host", &msnj); + g_provideInstance("ContentStore", "host", &cs); + g_provideInstance("ToxI", "host", &tc); g_provideInstance("ToxPrivateI", "host", &tpi); g_provideInstance("ToxEventProviderI", "host", &tc); diff --git a/src/main_screen.hpp b/src/main_screen.hpp index 2b7bb76..8f59dc4 100644 --- a/src/main_screen.hpp +++ b/src/main_screen.hpp @@ -12,6 +12,8 @@ #include #include "./tox_private_impl.hpp" +#include "./content/content.hpp" + #include #include #include @@ -53,6 +55,8 @@ struct MainScreen final : public Screen { MessageSerializerNJ msnj; MessageTimeSort mts; + ContentStore cs; + ToxEventLogger tel{std::cout}; ToxClient tc; ToxPrivateImpl tpi;