From 53505fe13d08042fc5b17a366a6e6cb767bf1e78 Mon Sep 17 00:00:00 2001 From: ikpil Date: Sat, 19 Aug 2023 12:48:02 +0900 Subject: [PATCH] add file TestTileCacheMeshProcess --- .../Io/MeshSetReaderWriterTest.cs | 2 +- .../AbstractTileCacheTest.cs | 17 +++++------------ .../TestTileCacheMeshProcess.cs | 12 ++++++++++++ 3 files changed, 18 insertions(+), 13 deletions(-) create mode 100644 test/DotRecast.Detour.TileCache.Test/TestTileCacheMeshProcess.cs diff --git a/test/DotRecast.Detour.Test/Io/MeshSetReaderWriterTest.cs b/test/DotRecast.Detour.Test/Io/MeshSetReaderWriterTest.cs index 916bfc1..1bb40d6 100644 --- a/test/DotRecast.Detour.Test/Io/MeshSetReaderWriterTest.cs +++ b/test/DotRecast.Detour.Test/Io/MeshSetReaderWriterTest.cs @@ -69,7 +69,7 @@ public class MeshSetReaderWriterTest RcVec3f bmin = geom.GetMeshBoundsMin(); RcVec3f bmax = geom.GetMeshBoundsMax(); - Recast.RcUtils.CalcTileCount(bmin, bmax, m_cellSize, m_tileSize, m_tileSize, out var tw, out var th); + RcUtils.CalcTileCount(bmin, bmax, m_cellSize, m_tileSize, m_tileSize, out var tw, out var th); for (int y = 0; y < th; ++y) { for (int x = 0; x < tw; ++x) diff --git a/test/DotRecast.Detour.TileCache.Test/AbstractTileCacheTest.cs b/test/DotRecast.Detour.TileCache.Test/AbstractTileCacheTest.cs index c349ccd..ed6a3be 100644 --- a/test/DotRecast.Detour.TileCache.Test/AbstractTileCacheTest.cs +++ b/test/DotRecast.Detour.TileCache.Test/AbstractTileCacheTest.cs @@ -21,6 +21,7 @@ freely, subject to the following restrictions: using DotRecast.Core; using DotRecast.Detour.TileCache.Io.Compress; using DotRecast.Detour.TileCache.Test.Io; +using DotRecast.Recast; using DotRecast.Recast.Geom; using NUnit.Framework; using static DotRecast.Core.RcMath; @@ -40,21 +41,11 @@ public class AbstractTileCacheTest private readonly float m_edgeMaxError = 1.3f; private readonly int m_tileSize = 48; - protected class TestTileCacheMeshProcess : IDtTileCacheMeshProcess - { - public void Process(DtNavMeshCreateParams option) - { - for (int i = 0; i < option.polyCount; ++i) - { - option.polyFlags[i] = 1; - } - } - } public DtTileCache GetTileCache(IInputGeomProvider geom, RcByteOrder order, bool cCompatibility) { DtTileCacheParams option = new DtTileCacheParams(); - Recast.RcUtils.CalcTileCount(geom.GetMeshBoundsMin(), geom.GetMeshBoundsMax(), m_cellSize, m_tileSize, m_tileSize, out var tw, out var th); + RcUtils.CalcTileCount(geom.GetMeshBoundsMin(), geom.GetMeshBoundsMax(), m_cellSize, m_tileSize, m_tileSize, out var tw, out var th); option.ch = m_cellHeight; option.cs = m_cellSize; option.orig = geom.GetMeshBoundsMin(); @@ -74,7 +65,9 @@ public class AbstractTileCacheTest navMeshParams.maxPolys = 16384; DtNavMesh navMesh = new DtNavMesh(navMeshParams, 6); var comp = DtTileCacheCompressorForTestFactory.Shared.Get(cCompatibility); - DtTileCache tc = new DtTileCache(option, new TileCacheStorageParams(order, cCompatibility), navMesh, comp, new TestTileCacheMeshProcess()); + var storageParams = new TileCacheStorageParams(order, cCompatibility); + var process = new TestTileCacheMeshProcess(); + DtTileCache tc = new DtTileCache(option, storageParams, navMesh, comp, process); return tc; } } \ No newline at end of file diff --git a/test/DotRecast.Detour.TileCache.Test/TestTileCacheMeshProcess.cs b/test/DotRecast.Detour.TileCache.Test/TestTileCacheMeshProcess.cs new file mode 100644 index 0000000..e27bab9 --- /dev/null +++ b/test/DotRecast.Detour.TileCache.Test/TestTileCacheMeshProcess.cs @@ -0,0 +1,12 @@ +namespace DotRecast.Detour.TileCache.Test; + +public class TestTileCacheMeshProcess : IDtTileCacheMeshProcess +{ + public void Process(DtNavMeshCreateParams option) + { + for (int i = 0; i < option.polyCount; ++i) + { + option.polyFlags[i] = 1; + } + } +} \ No newline at end of file