diff options
| author | untodesu <kirill@untode.su> | 2025-07-01 03:08:39 +0500 |
|---|---|---|
| committer | untodesu <kirill@untode.su> | 2025-07-01 03:08:39 +0500 |
| commit | 458e0005690ea9d579588a0a12368fc2c2c9a93a (patch) | |
| tree | 588a9ca6cb3c76d9193b5bd4601d64f0e50e8c8c /src/game/shared/item_registry.hh | |
| parent | c7b0c8e0286a1b2bb7ec55e579137dfc3b22eeb9 (diff) | |
| download | voxelius-458e0005690ea9d579588a0a12368fc2c2c9a93a.tar.bz2 voxelius-458e0005690ea9d579588a0a12368fc2c2c9a93a.zip | |
I hyper-focued on refactoring again
- I put a cool-sounding "we are number one" remix on repeat and straight
up grinded the entire repository to a better state until 03:09 AM. I
guess I have something wrong in my brain that makes me do this shit
Diffstat (limited to 'src/game/shared/item_registry.hh')
| -rw-r--r-- | src/game/shared/item_registry.hh | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/src/game/shared/item_registry.hh b/src/game/shared/item_registry.hh deleted file mode 100644 index 8847e97..0000000 --- a/src/game/shared/item_registry.hh +++ /dev/null @@ -1,62 +0,0 @@ -#ifndef SHARED_ITEM_REGISTRY_HH -#define SHARED_ITEM_REGISTRY_HH 1 -#pragma once - -#include "core/resource.hh" - -#include "shared/types.hh" - -// This resource is only defined client-side and -// resource_ptr<TextureGUI> should remain set to null -// anywhere else in the shared and server code -struct TextureGUI; - -struct ItemInfo final { - std::string name; - std::string texture; - voxel_id place_voxel; - - resource_ptr<TextureGUI> cached_texture; // Client-side only -}; - -class ItemInfoBuilder final { -public: - explicit ItemInfoBuilder(const char* name); - virtual ~ItemInfoBuilder(void) = default; - -public: - ItemInfoBuilder& set_texture(const char* texture); - ItemInfoBuilder& set_place_voxel(voxel_id place_voxel); - -public: - item_id build(void) const; - -private: - ItemInfo prototype; -}; - -namespace item_registry -{ -extern std::unordered_map<std::string, ItemInfoBuilder> builders; -extern std::unordered_map<std::string, item_id> names; -extern std::vector<std::shared_ptr<ItemInfo>> items; -} // namespace item_registry - -namespace item_registry -{ -ItemInfoBuilder& construct(const char* name); -ItemInfo* find(const char* name); -ItemInfo* find(const item_id item); -} // namespace item_registry - -namespace item_registry -{ -void purge(void); -} // namespace item_registry - -namespace item_registry -{ -std::uint64_t calcualte_checksum(void); -} // namespace item_registry - -#endif // SHARED_ITEM_REGISTRY_HH |
