mirror of
https://github.com/kwsch/NHSE.git
synced 2026-05-25 11:47:36 -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.
29 lines
685 B
C#
29 lines
685 B
C#
using System.Linq;
|
|
using FluentAssertions;
|
|
using NHSE.Core;
|
|
using Xunit;
|
|
|
|
namespace NHSE.Tests;
|
|
|
|
public static class BuildingTests
|
|
{
|
|
[Fact]
|
|
public static void BuildingMarshal()
|
|
{
|
|
var building = new Building();
|
|
var bytes = building.ToBytesClass();
|
|
bytes.Length.Should().Be(Building.SIZE);
|
|
}
|
|
|
|
[Fact]
|
|
public static void BuildingClear()
|
|
{
|
|
var item = new Building {BuildingType = BuildingType.PlayerHouse1, X=5, Y=7};
|
|
var bytes = item.ToBytesClass();
|
|
bytes.Any(z => z != 0).Should().BeTrue();
|
|
|
|
item.Clear();
|
|
bytes = item.ToBytesClass();
|
|
bytes.Any(z => z != 0).Should().BeFalse();
|
|
}
|
|
} |