summaryrefslogtreecommitdiff
path: root/Client/Assets/Scripts/XMainClient/ProtoBuf/Serializers/UInt32Serializer.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Client/Assets/Scripts/XMainClient/ProtoBuf/Serializers/UInt32Serializer.cs')
-rw-r--r--Client/Assets/Scripts/XMainClient/ProtoBuf/Serializers/UInt32Serializer.cs49
1 files changed, 49 insertions, 0 deletions
diff --git a/Client/Assets/Scripts/XMainClient/ProtoBuf/Serializers/UInt32Serializer.cs b/Client/Assets/Scripts/XMainClient/ProtoBuf/Serializers/UInt32Serializer.cs
new file mode 100644
index 00000000..1f63d4d8
--- /dev/null
+++ b/Client/Assets/Scripts/XMainClient/ProtoBuf/Serializers/UInt32Serializer.cs
@@ -0,0 +1,49 @@
+using System;
+using ProtoBuf.Meta;
+
+namespace ProtoBuf.Serializers
+{
+ internal sealed class UInt32Serializer : IProtoSerializer
+ {
+ public Type ExpectedType
+ {
+ get
+ {
+ return UInt32Serializer.expectedType;
+ }
+ }
+
+ bool IProtoSerializer.RequiresOldValue
+ {
+ get
+ {
+ return false;
+ }
+ }
+
+ bool IProtoSerializer.ReturnsValue
+ {
+ get
+ {
+ return true;
+ }
+ }
+
+ private static readonly Type expectedType = typeof(uint);
+
+ public UInt32Serializer(TypeModel model)
+ {
+ }
+
+ public object Read(object value, ProtoReader source)
+ {
+ Helpers.DebugAssert(value == null);
+ return source.ReadUInt32();
+ }
+
+ public void Write(object value, ProtoWriter dest)
+ {
+ ProtoWriter.WriteUInt32((uint)value, dest);
+ }
+ }
+}