コード例 #1
0
        private GridTileLookupChunk GetOrCreateChunk(GridId gridId, Vector2i indices)
        {
            var chunkIndices = GetChunkIndices(indices);

            if (!_graph.TryGetValue(gridId, out var gridChunks))
            {
                gridChunks     = new Dictionary <Vector2i, GridTileLookupChunk>();
                _graph[gridId] = gridChunks;
            }

            if (!gridChunks.TryGetValue(chunkIndices, out var chunk))
            {
                chunk = new GridTileLookupChunk(gridId, chunkIndices);
                gridChunks[chunkIndices] = chunk;
            }

            return(chunk);
        }
コード例 #2
0
 internal GridTileLookupNode(GridTileLookupChunk parentChunk, Vector2i indices)
 {
     ParentChunk = parentChunk;
     Indices     = indices;
 }
コード例 #3
0
 internal GridTileLookupNode(GridTileLookupChunk parentChunk, MapIndices indices)
 {
     ParentChunk = parentChunk;
     Indices     = indices;
 }