コード例 #1
0
ファイル: BinarySerializer.cs プロジェクト: voledyhil/MiniEcs
        public static byte[] Serialize(object obj, Baseline <byte> baseline)
        {
            CompositeBinarySerializer serializer = GetSerializer(obj.GetType());

            if (!baseline.HasValues)
            {
                baseline.CreateValues(serializer.Count);
            }

            using (BinaryDataWriter writer = new BinaryDataWriter())
            {
                serializer.Serialize(obj, writer, baseline);
                return(writer.GetData());
            }
        }