Files
axyz/include/Engine/Core/ComponentInfo.h
T
Jocke 236230d12c Packets now dynamically allocates more memory when they need it.
Increased local receive buffer for Client and Server() and removed the magic number that was used
In Server.h and Client.h
(char readBuffer[INPUTSIZE] = { 0 }).
Packets start size has now been increased to 512 bytes.
Changed ComponentInfo::FieldsInOrder to store strings instead of pointers.
Removed HasEntity() and are now using ValidEntity() instead.
2016-01-12 12:00:19 +01:00

39 lines
701 B
C++

#ifndef ComponentInfo_h__
#define ComponentInfo_h__
#include "../Common.h"
struct ComponentInfo
{
struct Meta_t
{
std::string Annotation;
unsigned int Allocation = 0;
unsigned int Stride = 0;
};
struct Field_t
{
std::string Name;
std::string Type;
unsigned int Offset;
unsigned int Stride;
};
std::string Name;
std::unordered_map<std::string, Field_t> Fields;
std::vector<std::string> FieldsInOrder;
Meta_t Meta;
std::shared_ptr<char> Defaults = nullptr;
};
template<>
struct std::hash<ComponentInfo>
{
inline std::size_t operator()(const ComponentInfo& v) const
{
return std::hash<std::string>()(v.Name);
}
};
#endif