refactor: Add BitMask256 utility for 256-bit bitmask operations (#2300)
### Summary - Create BitMask256 struct with scalar operations (benchmarks showed AVX2 vectorization provides no benefit for this size) - Refactor Map.cs to use BitMask256 for full Z range support (-128 to 127) - Remove SectorSpawnCache struct, use BitMask256 directly in manager - Update tests to use BitMask256 directly - Remove unused test assertions for old 64-bit behavior
This commit is contained in:
parent
d3b43f6f0e
commit
598223703f
7 changed files with 482 additions and 261 deletions
|
|
@ -9,8 +9,6 @@ namespace Server.Tests.Tests.Maps;
|
|||
[Collection("Sequential Server Tests")]
|
||||
public class CanSpawnMobileTests
|
||||
{
|
||||
#region Basic Validation Tests
|
||||
|
||||
[Fact]
|
||||
public void CanSpawnMobile_InternalMapReturnsFalse()
|
||||
{
|
||||
|
|
@ -31,10 +29,6 @@ public class CanSpawnMobileTests
|
|||
Assert.False(map.CanSpawnMobile(100, map.Height + 1, -128, 127, false, false, out _));
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Land Surface Tests
|
||||
|
||||
// Use coordinates near Britain which should be walkable land in both test and real data
|
||||
private const int TestLandX = 1500;
|
||||
private const int TestLandY = 1600;
|
||||
|
|
@ -74,10 +68,6 @@ public class CanSpawnMobileTests
|
|||
Assert.False(result, "cantWalk=true should not find land as valid surface");
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Mobile Blocking Tests
|
||||
|
||||
[Fact]
|
||||
public void CanSpawnMobile_MobileBlocksSpawn()
|
||||
{
|
||||
|
|
@ -162,10 +152,6 @@ public class CanSpawnMobileTests
|
|||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
#region Helper Classes
|
||||
|
||||
private class TestMobile : Mobile
|
||||
{
|
||||
public TestMobile()
|
||||
|
|
@ -174,6 +160,4 @@ public class CanSpawnMobileTests
|
|||
Hidden = false;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue