Starting work on drawing program layers
This commit is contained in:
parent
c2e85e8a62
commit
a29c5dc926
14 changed files with 334 additions and 138 deletions
|
|
@ -18,6 +18,8 @@ class NetObjManagerTypeList {
|
|||
std::function<void(const NetObjTemporaryPtr<ServerT>&, cereal::PortableBinaryInputArchive&, const std::shared_ptr<NetServer::ClientData>&)> readUpdateFuncServer;
|
||||
};
|
||||
template <typename ClientT, typename ServerT, typename ClientAllocatedType, typename ServerAllocatedType> void register_class(const ServerClientClassFunctions<ClientT, ServerT>& funcs) {
|
||||
if((netTypeID + 1) == 0) // Unsigned type wraps around, so check if we're already at class count limit (if we are, we have to increase the size of NetTypeIDType)
|
||||
throw std::runtime_error("[NetObjManagerTypeList::register_class] Reached limit of number of classes that can be registered. Increase the size of NetTypeIDType to continue");
|
||||
typeIndexFunctionsClient[std::type_index(typeid(ClientT*))] = TypeIndexFunctions {
|
||||
.readConstructorFunc = [f = funcs.readConstructorFuncClient](const NetObjTemporaryPtr<void>& obj, cereal::PortableBinaryInputArchive& message, const std::shared_ptr<NetServer::ClientData>& c) {
|
||||
f(obj.cast<ClientT>(), message, c);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue