mirror of
https://github.com/kwsch/NHSE.git
synced 2026-03-21 17:24:30 -05:00
Updates the Field Item Editor to render layers based on the entire map, and the per-patch positioning of each layer. Import/export will gracefully handle upgrade/downgrade, and viewport import/export will gracefully update tiles rather than a per-acre basis. Performance has also been slightly improved; no allocation is done anymore when updating the image.
21 lines
534 B
C#
21 lines
534 B
C#
using System;
|
|
using FluentAssertions;
|
|
using NHSE.Core;
|
|
using Xunit;
|
|
|
|
namespace NHSE.Tests;
|
|
|
|
public static class EncryptedIntTests
|
|
{
|
|
[Fact]
|
|
public static void TestParse()
|
|
{
|
|
const int expect = 31_280;
|
|
ReadOnlySpan<byte> data = [0x8A, 0xC4, 0xE3, 0xCF, 0x37, 0xD5, 0x1A, 0xD3];
|
|
var val = EncryptedInt32.ReadVerify(data, 0);
|
|
val.Value.Should().Be(expect);
|
|
|
|
var encode = EncryptedInt32.Encrypt(expect, val.Shift, val.Adjust);
|
|
val.OriginalEncrypted.Should().Be(encode);
|
|
}
|
|
} |