#pragma once #include "Engine/Vfs/content_catalogs.h" #include #include #include #include // The Object Browser's category tree, taken from the game's category service // records in the content cache. Objects the cache does not place fall back to // one tile each under their installed family. namespace dingosdk::objects { struct InstalledObject { std::string key, family, title; }; struct BrowserTile { std::string id, title; std::uint32_t priority{}; std::vector items; }; struct BrowserCategory { std::string id, title; std::uint32_t priority{}; std::vector tiles; }; struct Placement { const content_cache::ObjectCategory* category{}; const content_cache::ObjectGroup* group{}; }; // Group id -> its place in the tree. Browser categories win over other build-kit ones. std::map> object_groups(const content_cache::Catalogs& catalogs); // Where one object sits, or nothing when the cache does not place it. Placement object_placement(std::string_view key, const content_cache::Catalogs& catalogs, const std::map>& groups); // The tile an object belongs to: its group, or the object itself. std::string browser_tile(std::string_view key, const content_cache::Catalogs& catalogs, const std::map>& groups); // Browser categories first, then other build-kit categories, then unplaced families. std::vector browser_layout(const std::vector& objects, const content_cache::Catalogs& catalogs); }