mirror of
https://github.com/Facepunch/sbox-public.git
synced 2026-01-12 16:28:27 -05:00
This commit imports the C# engine code and game files, excluding C++ source code. [Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
26 lines
825 B
C#
26 lines
825 B
C#
namespace Sandbox;
|
|
|
|
internal partial class BytePack
|
|
{
|
|
/// <summary>
|
|
/// Allows classes to specify how they are to be serialized and deserialized through BytePack.
|
|
/// </summary>
|
|
public interface ISerializer
|
|
{
|
|
/// <summary>
|
|
/// Read from a <see cref="ByteStream"/> and return an object.
|
|
/// </summary>
|
|
/// <param name="bs">The incoming byte stream.</param>
|
|
/// <param name="targetType">The expected type.</param>
|
|
/// <returns></returns>
|
|
static abstract object BytePackRead( ref ByteStream bs, Type targetType );
|
|
|
|
/// <summary>
|
|
/// Write a value to an outgoing <see cref="ByteStream"/>.
|
|
/// </summary>
|
|
/// <param name="value">The value to be serialized.</param>
|
|
/// <param name="bs">The outgoing byte stream.</param>
|
|
static abstract void BytePackWrite( object value, ref ByteStream bs );
|
|
}
|
|
}
|