diff --git a/NetSerializer/Serializer.cs b/NetSerializer/Serializer.cs index 2a17e03..a6e64b0 100644 --- a/NetSerializer/Serializer.cs +++ b/NetSerializer/Serializer.cs @@ -16,8 +16,8 @@ namespace NetSerializer { - delegate void SerializeDelegate(Serializer serializer, Stream stream, T ob); - delegate void DeserializeDelegate(Serializer serializer, Stream stream, out T ob); + public delegate void SerializeDelegate(Serializer serializer, Stream stream, T ob); + public delegate void DeserializeDelegate(Serializer serializer, Stream stream, out T ob); public class Serializer { @@ -215,7 +215,7 @@ public void DeserializeDirect(Stream stream, out T value) del(this, stream, out value); } - internal uint GetTypeIdAndSerializer(Type type, out SerializeDelegate del) + public uint GetTypeIdAndSerializer(Type type, out SerializeDelegate del) { var data = m_runtimeTypeMap[type]; @@ -232,7 +232,13 @@ internal uint GetTypeIdAndSerializer(Type type, out SerializeDelegate de } } - internal DeserializeDelegate GetDeserializeTrampolineFromId(uint id) + public Type GetTypeFromId(uint id) + { + var data = m_runtimeTypeIDList[id]; + return data.Type; + } + + public DeserializeDelegate GetDeserializeTrampolineFromId(uint id) { var data = m_runtimeTypeIDList[id];