Major networking refactoring to allow for snapshot filtering outside of netcode

This commit is contained in:
2016-02-09 13:22:21 +01:00
parent 2b4e00e4b0
commit d3bc48f5f7
28 changed files with 382 additions and 198 deletions
+13
View File
@@ -1,6 +1,7 @@
#ifndef ComponentWrapper_h__
#define ComponentWrapper_h__
#include <boost/shared_array.hpp>
#include "../Common.h"
#include "Entity.h"
#include "ComponentInfo.h"
@@ -76,6 +77,18 @@ struct ComponentWrapper
SubscriptProxy operator[](std::string propertyName) { return SubscriptProxy(this, propertyName); }
};
// A component wrapper that "owns" its data through a shared pointer
struct SharedComponentWrapper : ComponentWrapper
{
SharedComponentWrapper(const ComponentInfo& componentInfo, boost::shared_array<char> data)
: ComponentWrapper(componentInfo, data.get())
, m_DataReference(data)
{ }
private:
boost::shared_array<char> m_DataReference;
};
// TODO: Move this to Tests once entity importing is finished
class ComponentWrapperFactory
{