From 9a03ade6c929d396fab8fb0cd0e67297761dd82a Mon Sep 17 00:00:00 2001 From: ikpil Date: Tue, 21 May 2024 00:11:08 +0900 Subject: [PATCH] Changed `DtTileCacheBuilder` to a static class --- src/DotRecast.Detour.TileCache/DtTileCache.cs | 2 -- src/DotRecast.Detour.TileCache/DtTileCacheBuilder.cs | 3 ++- src/DotRecast.Detour.TileCache/DtTileCacheLayerBuilder.cs | 1 - src/DotRecast.Detour.TileCache/Io/DtTileCacheWriter.cs | 1 - 4 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/DotRecast.Detour.TileCache/DtTileCache.cs b/src/DotRecast.Detour.TileCache/DtTileCache.cs index 6423305..26fce63 100644 --- a/src/DotRecast.Detour.TileCache/DtTileCache.cs +++ b/src/DotRecast.Detour.TileCache/DtTileCache.cs @@ -53,8 +53,6 @@ namespace DotRecast.Detour.TileCache private readonly List m_reqs = new List(); private readonly List m_update = new List(); - private readonly DtTileCacheBuilder builder = new DtTileCacheBuilder(); - public DtTileCache(DtTileCacheParams option, DtTileCacheStorageParams storageParams, DtNavMesh navmesh, IRcCompressor tcomp, IDtTileCacheMeshProcess tmprocs) { m_params = option; diff --git a/src/DotRecast.Detour.TileCache/DtTileCacheBuilder.cs b/src/DotRecast.Detour.TileCache/DtTileCacheBuilder.cs index d73905c..6c5d059 100644 --- a/src/DotRecast.Detour.TileCache/DtTileCacheBuilder.cs +++ b/src/DotRecast.Detour.TileCache/DtTileCacheBuilder.cs @@ -29,11 +29,12 @@ using DotRecast.Recast; namespace DotRecast.Detour.TileCache { - public class DtTileCacheBuilder + public static class DtTileCacheBuilder { public const int DT_TILECACHE_NULL_AREA = 0; public const int DT_TILECACHE_WALKABLE_AREA = 63; public const int DT_TILECACHE_NULL_IDX = 0xffff; + private static readonly int[] DirOffsetX = { -1, 0, 1, 0, }; private static readonly int[] DirOffsetY = { 0, 1, 0, -1 }; diff --git a/src/DotRecast.Detour.TileCache/DtTileCacheLayerBuilder.cs b/src/DotRecast.Detour.TileCache/DtTileCacheLayerBuilder.cs index bd172d1..674b680 100644 --- a/src/DotRecast.Detour.TileCache/DtTileCacheLayerBuilder.cs +++ b/src/DotRecast.Detour.TileCache/DtTileCacheLayerBuilder.cs @@ -100,7 +100,6 @@ namespace DotRecast.Detour.TileCache List result = new List(); if (lset != null) { - DtTileCacheBuilder builder = new DtTileCacheBuilder(); for (int i = 0; i < lset.layers.Length; ++i) { RcHeightfieldLayer layer = lset.layers[i]; diff --git a/src/DotRecast.Detour.TileCache/Io/DtTileCacheWriter.cs b/src/DotRecast.Detour.TileCache/Io/DtTileCacheWriter.cs index 2268263..14438d5 100644 --- a/src/DotRecast.Detour.TileCache/Io/DtTileCacheWriter.cs +++ b/src/DotRecast.Detour.TileCache/Io/DtTileCacheWriter.cs @@ -28,7 +28,6 @@ namespace DotRecast.Detour.TileCache.Io public class DtTileCacheWriter : DtWriter { private readonly DtNavMeshParamWriter paramWriter = new DtNavMeshParamWriter(); - private readonly DtTileCacheBuilder builder = new DtTileCacheBuilder(); private readonly IDtTileCacheCompressorFactory _compFactory; public DtTileCacheWriter(IDtTileCacheCompressorFactory compFactory)