Implements basics for UserData
This commit is contained in:
21
src/UserData/UserDataStorage.hpp
Normal file
21
src/UserData/UserDataStorage.hpp
Normal file
@@ -0,0 +1,21 @@
|
||||
|
||||
#ifndef PORYGONLANG_USERDATASTORAGE_HPP
|
||||
#define PORYGONLANG_USERDATASTORAGE_HPP
|
||||
|
||||
#include <unordered_map>
|
||||
#include "UserData.hpp"
|
||||
|
||||
class UserDataStorage {
|
||||
static std::unordered_map<int, UserData*> _userData;
|
||||
public:
|
||||
static void RegisterType(int i, UserData* ud){
|
||||
UserDataStorage::_userData.insert({i, ud});
|
||||
}
|
||||
|
||||
static UserData* GetUserDataType(int i){
|
||||
return UserDataStorage::_userData[i];
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
#endif //PORYGONLANG_USERDATASTORAGE_HPP
|
||||
Reference in New Issue
Block a user