fpopov thanks

This commit is contained in:
bird_egop
2026-05-09 20:36:43 +03:00
parent d73a6dde70
commit eb458ad9a8
43 changed files with 1562 additions and 1233 deletions
+9 -4
View File
@@ -3,9 +3,14 @@ using System.Runtime.InteropServices;
namespace Common;
/// <summary>DEBUG ONLY. Одни и те же 4 байта, интерпретированные как int32 и float32.</summary>
/// <param name="AsInt">Значение как int32.</param>
/// <param name="AsFloat">Значение как float32.</param>
[DebuggerDisplay("AsInt = {AsInt}, AsFloat = {AsFloat}")]
public class IntFloatValue(Span<byte> span)
public record class IntFloatValue(int AsInt, float AsFloat)
{
public int AsInt { get; set; } = MemoryMarshal.Read<int>(span);
public float AsFloat { get; set; } = MemoryMarshal.Read<float>(span);
}
public IntFloatValue(Span<byte> span)
: this(MemoryMarshal.Read<int>(span), MemoryMarshal.Read<float>(span))
{
}
}