forked from mirror/DotRecast
Changed `DtTileCacheBuilder` to a static class
This commit is contained in:
parent
8f8db51542
commit
9a03ade6c9
|
@ -53,8 +53,6 @@ namespace DotRecast.Detour.TileCache
|
||||||
private readonly List<DtObstacleRequest> m_reqs = new List<DtObstacleRequest>();
|
private readonly List<DtObstacleRequest> m_reqs = new List<DtObstacleRequest>();
|
||||||
private readonly List<long> m_update = new List<long>();
|
private readonly List<long> m_update = new List<long>();
|
||||||
|
|
||||||
private readonly DtTileCacheBuilder builder = new DtTileCacheBuilder();
|
|
||||||
|
|
||||||
public DtTileCache(DtTileCacheParams option, DtTileCacheStorageParams storageParams, DtNavMesh navmesh, IRcCompressor tcomp, IDtTileCacheMeshProcess tmprocs)
|
public DtTileCache(DtTileCacheParams option, DtTileCacheStorageParams storageParams, DtNavMesh navmesh, IRcCompressor tcomp, IDtTileCacheMeshProcess tmprocs)
|
||||||
{
|
{
|
||||||
m_params = option;
|
m_params = option;
|
||||||
|
|
|
@ -29,11 +29,12 @@ using DotRecast.Recast;
|
||||||
|
|
||||||
namespace DotRecast.Detour.TileCache
|
namespace DotRecast.Detour.TileCache
|
||||||
{
|
{
|
||||||
public class DtTileCacheBuilder
|
public static class DtTileCacheBuilder
|
||||||
{
|
{
|
||||||
public const int DT_TILECACHE_NULL_AREA = 0;
|
public const int DT_TILECACHE_NULL_AREA = 0;
|
||||||
public const int DT_TILECACHE_WALKABLE_AREA = 63;
|
public const int DT_TILECACHE_WALKABLE_AREA = 63;
|
||||||
public const int DT_TILECACHE_NULL_IDX = 0xffff;
|
public const int DT_TILECACHE_NULL_IDX = 0xffff;
|
||||||
|
|
||||||
private static readonly int[] DirOffsetX = { -1, 0, 1, 0, };
|
private static readonly int[] DirOffsetX = { -1, 0, 1, 0, };
|
||||||
private static readonly int[] DirOffsetY = { 0, 1, 0, -1 };
|
private static readonly int[] DirOffsetY = { 0, 1, 0, -1 };
|
||||||
|
|
||||||
|
|
|
@ -100,7 +100,6 @@ namespace DotRecast.Detour.TileCache
|
||||||
List<byte[]> result = new List<byte[]>();
|
List<byte[]> result = new List<byte[]>();
|
||||||
if (lset != null)
|
if (lset != null)
|
||||||
{
|
{
|
||||||
DtTileCacheBuilder builder = new DtTileCacheBuilder();
|
|
||||||
for (int i = 0; i < lset.layers.Length; ++i)
|
for (int i = 0; i < lset.layers.Length; ++i)
|
||||||
{
|
{
|
||||||
RcHeightfieldLayer layer = lset.layers[i];
|
RcHeightfieldLayer layer = lset.layers[i];
|
||||||
|
|
|
@ -28,7 +28,6 @@ namespace DotRecast.Detour.TileCache.Io
|
||||||
public class DtTileCacheWriter : DtWriter
|
public class DtTileCacheWriter : DtWriter
|
||||||
{
|
{
|
||||||
private readonly DtNavMeshParamWriter paramWriter = new DtNavMeshParamWriter();
|
private readonly DtNavMeshParamWriter paramWriter = new DtNavMeshParamWriter();
|
||||||
private readonly DtTileCacheBuilder builder = new DtTileCacheBuilder();
|
|
||||||
private readonly IDtTileCacheCompressorFactory _compFactory;
|
private readonly IDtTileCacheCompressorFactory _compFactory;
|
||||||
|
|
||||||
public DtTileCacheWriter(IDtTileCacheCompressorFactory compFactory)
|
public DtTileCacheWriter(IDtTileCacheCompressorFactory compFactory)
|
||||||
|
|
Loading…
Reference in New Issue