mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-07-22 18:39:18 +02:00
ECS System WIP
This commit is contained in:
18
registry/NameRegistry.h
Normal file
18
registry/NameRegistry.h
Normal file
@@ -0,0 +1,18 @@
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include <mutex>
|
||||
#include <string>
|
||||
#include <string_view>
|
||||
#include <unordered_map>
|
||||
|
||||
class NameRegistry
|
||||
{
|
||||
public:
|
||||
static uint64_t GetOrCreate(std::string_view name);
|
||||
static const std::string& GetString(uint64_t id);
|
||||
|
||||
private:
|
||||
static std::unordered_map<uint64_t, std::string>& GetMap();
|
||||
static std::mutex& GetMutex();
|
||||
};
|
||||
Reference in New Issue
Block a user