Aetheria/tests/Aetheria.Shared.Tests/MineLauncherCatalogTests.cs
Meta Vens fb00f6687d Mines presented: MineInstance draws each Zone.Mines body; Mine Launcher catalog command; WireMines builds the prefab
MineInstance reads a Mine and draws it (latest sim body at the grid height, spin, real-time pulse by arming and
trigger); ZoneRenderer makes one per Zone.Mines add and plays the blast on remove; EntityInstance gives a mine
layer no effect manager. AetherDb mine-launcher authors the item; the catalog, prefab and scene wiring follow in
later commits, so this one does not build a playable mine (no MinePrefab yet).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-08 13:49:23 +02:00

28 lines
1.2 KiB
C#

using System.Linq;
using Xunit;
// sim-mines-presenter: the shipped catalog carries the Mine Launcher a ship can be fitted with, and what it
// carries is what the sim's mine layer reads (MineLayerData for the mine's own timings, the item's WeaponType,
// Fuse and BlastRadius for the layer and the blast).
public sealed class MineLauncherCatalogTests
{
[Fact]
public void TheShippedCatalogHasAMineLauncherThatLaysMines()
{
var cache = RestoredHullsTests.OpenCatalog();
var launcher = Assert.Single(cache.GetAll<GearData>().OfType<WeaponItemData>(), item => item.Name == "Mine Launcher");
Assert.Equal(HardpointType.Launcher, launcher.HardpointType);
Assert.Equal(WeaponType.Mine, launcher.WeaponType);
Assert.Equal(WeaponFuse.Proximity, launcher.Fuse);
Assert.Equal(25f, launcher.BlastRadius);
var layer = Assert.IsType<MineLayerData>(Assert.Single(launcher.Behaviors));
Assert.Equal(2f, layer.ArmingDelay);
Assert.Equal(2f, layer.FuseDelay);
Assert.Equal(30f, layer.Lifetime);
Assert.True(layer.Damage.Max > 0f);
Assert.True(layer.Velocity.Max > 0f);
Assert.True(layer.Cooldown.Max > 0f);
}
}