Files
PURErat-crack-scode/decompiled/purerat decompiled/PureCrack.Wire/ProtoValue.cs
T

40 lines
751 B
C#
Raw Normal View History

2026-08-27 10:56:38 -06:00
using System;
namespace PureCrack.Wire;
public sealed class ProtoValue
{
public ProtoWire Wire { get; }
public byte[] Bytes { get; }
public ulong Number { get; }
private ProtoValue(ProtoWire wire, byte[] bytes, ulong number)
{
Wire = wire;
Bytes = bytes;
Number = number;
}
public static ProtoValue OfVarint(ulong v)
{
return new ProtoValue(ProtoWire.Varint, Array.Empty<byte>(), v);
}
public static ProtoValue OfBytes(byte[] b)
{
return new ProtoValue(ProtoWire.Bytes, b, 0uL);
}
public static ProtoValue OfFixed64(ulong v)
{
return new ProtoValue(ProtoWire.Fixed64, Array.Empty<byte>(), v);
}
public static ProtoValue OfFixed32(uint v)
{
return new ProtoValue(ProtoWire.Fixed32, Array.Empty<byte>(), v);
}
}