< Summary

Information
Class: GridForge.Grids.Voxel
Assembly: GridForge
File(s): /home/runner/work/GridForge/GridForge/src/GridForge/Grids/Nodes/Voxel.cs
Line coverage
100%
Covered lines: 207
Uncovered lines: 0
Coverable lines: 207
Total lines: 635
Line coverage: 100%
Branch coverage
100%
Covered branches: 102
Total branches: 102
Branch coverage: 100%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

File(s)

/home/runner/work/GridForge/GridForge/src/GridForge/Grids/Nodes/Voxel.cs

#LineLine coverage
 1//=======================================================================
 2// Voxel.cs
 3//=======================================================================
 4// MIT License, Copyright (c) 2024-present David Oravsky (mrdav30)
 5// See LICENSE file in the project root for full license information.
 6//=======================================================================
 7
 8using System;
 9using System.Runtime.CompilerServices;
 10using FixedMathSharp;
 11using GridForge.Grids.Topology;
 12using GridForge.Spatial;
 13using SwiftCollections;
 14using SwiftCollections.Pool;
 15
 16namespace GridForge.Grids;
 17
 18/// <summary>
 19/// Represents a voxel within a 3D grid, handling spatial positioning, obstacles, occupants, and neighbor relationships.
 20/// </summary>
 21public class Voxel : IEquatable<Voxel>
 22{
 23    #region Properties & Fields
 24
 25    /// <summary>
 26    /// The world-scoped runtime identity of this voxel within the grid system.
 27    /// </summary>
 28    public WorldVoxelIndex WorldIndex { get; set; }
 29
 30    /// <summary>
 31    /// The world-local index of the grid this voxel belongs to.
 32    /// </summary>
 5333    public ushort GridIndex => WorldIndex.GridIndex;
 34
 35    /// <summary>
 36    /// The local coordinates of this voxel within its grid.
 37    /// </summary>
 2774338    public VoxelIndex Index => WorldIndex.VoxelIndex;
 39
 40    /// <summary>
 41    /// The grid-local key of the scan cell that this voxel belongs to.
 42    /// </summary>
 43    public int ScanCellKey { get; private set; }
 44
 45    /// <summary>
 46    /// The world-space position of this voxel.
 47    /// </summary>
 48    public Vector3d WorldPosition { get; private set; }
 49
 50    /// <summary>
 51    /// Stores the process-unique identity of each obstacle registration added to this voxel.
 52    /// </summary>
 53    public SwiftHashSet<ObstacleToken>? ObstacleTracker { get; internal set; }
 54
 55    /// <summary>
 56    /// The current number of obstacles on this voxel.
 57    /// </summary>
 58    public byte ObstacleCount { get; internal set; }
 59
 60    /// <summary>
 61    /// The current number of occupants on this voxel.
 62    /// </summary>
 63    public byte OccupantCount { get; internal set; }
 64
 65    /// <summary>
 66    /// Handles management of partitioned data.
 67    /// </summary>
 32874168    private readonly PartitionProvider<IVoxelPartition> _partitionProvider = new();
 69
 70    /// <summary>
 71    /// Indicates whether this voxel has any active partitions.
 72    /// </summary>
 893973    public bool IsPartioned => !_partitionProvider.IsEmpty;
 74
 32874175    private readonly object _partitionLock = new();
 76
 77    /// <summary>
 78    /// Determines if this voxel is a boundary voxel.
 79    /// </summary>
 80    public bool IsBoundaryVoxel { get; private set; }
 81
 82    /// <summary>
 83    /// The current version of the grid at the time this voxel was created.
 84    /// </summary>
 85    public uint CachedGridVersion { get; internal set; }
 86
 87    /// <summary>
 88    /// Indicates whether this voxel is allocated within a grid.
 89    /// </summary>
 90    public bool IsAllocated { get; private set; }
 91
 92    /// <summary>
 93    /// Determines whether this voxel is blocked due to obstacles.
 94    /// </summary>
 1851495    public bool IsBlocked => IsAllocated && ObstacleCount > 0;
 96
 97    /// <summary>
 98    /// Determines if this voxel can accept additional obstacles.
 99    /// </summary>
 1036100    public bool IsBlockable => IsAllocated
 1036101        && ObstacleCount < GridObstacleManager.MaxObstacleCount
 1036102        && !IsOccupied;
 103
 104    /// <summary>
 105    /// Determines whether this voxel is occupied by entities.
 106    /// </summary>
 18982107    public bool IsOccupied => IsAllocated && OccupantCount > 0;
 108
 109    /// <summary>
 110    /// Checks if this voxel has open slots for new occupants.
 111    /// </summary>
 838112    public bool HasVacancy => !IsBlocked && OccupantCount < GridOccupantManager.MaxOccupantCount;
 113
 114    internal bool HasEventSubscribers =>
 146115        _onObstacleAdded != null
 146116        || _onObstacleRemoved != null
 146117        || _onObstaclesCleared != null
 146118        || _onOccupantAdded != null
 146119        || _onOccupantRemoved != null;
 120
 121    #endregion
 122
 123    #region Events
 124
 125    /// <summary>
 126    /// Event triggered when an obstacle is added.
 127    /// </summary>
 128    private Action<ObstacleEventInfo>? _onObstacleAdded;
 129
 130    /// <inheritdoc cref="_onObstacleAdded"/>
 131    public event Action<ObstacleEventInfo> OnObstacleAdded
 132    {
 4133        add => _onObstacleAdded += value;
 4134        remove => _onObstacleAdded -= value;
 135    }
 136
 137    /// <summary>
 138    /// Event triggered when an obstacle is removed.
 139    /// </summary>
 140    private Action<ObstacleEventInfo>? _onObstacleRemoved;
 141
 142    /// <inheritdoc cref="_onObstacleRemoved"/>
 143    public event Action<ObstacleEventInfo> OnObstacleRemoved
 144    {
 3145        add => _onObstacleRemoved += value;
 3146        remove => _onObstacleRemoved -= value;
 147    }
 148
 149    /// <summary>
 150    /// Event triggered when all obstacles on the voxel are cleared at once.
 151    /// </summary>
 152    private Action<ObstacleClearEventInfo>? _onObstaclesCleared;
 153
 154    /// <inheritdoc cref="_onObstaclesCleared"/>
 155    public event Action<ObstacleClearEventInfo> OnObstaclesCleared
 156    {
 2157        add => _onObstaclesCleared += value;
 2158        remove => _onObstaclesCleared -= value;
 159    }
 160
 161    /// <summary>
 162    /// Event triggered when an occupant is added.
 163    /// </summary>
 164    private Action<OccupantEventInfo>? _onOccupantAdded;
 165
 166    /// <inheritdoc cref="_onOccupantAdded"/>
 167    public event Action<OccupantEventInfo> OnOccupantAdded
 168    {
 2169        add => _onOccupantAdded += value;
 2170        remove => _onOccupantAdded -= value;
 171    }
 172
 173    /// <summary>
 174    /// Event triggered when an occupant is removed.
 175    /// </summary>
 176    private Action<OccupantEventInfo>? _onOccupantRemoved;
 177
 178    /// <inheritdoc cref="_onOccupantRemoved"/>
 179    public event Action<OccupantEventInfo> OnOccupantRemoved
 180    {
 2181        add => _onOccupantRemoved += value;
 2182        remove => _onOccupantRemoved -= value;
 183    }
 184
 185    #endregion
 186
 187    #region Initialization & Reset
 188
 189    /// <summary>
 190    /// Configures the voxel with its position, grid version, and boundary status.
 191    /// </summary>
 192    internal void Initialize(
 193        WorldVoxelIndex worldVoxelIndex,
 194        Vector3d worldPosition,
 195        int scanCellKey,
 196        bool isBoundaryVoxel,
 197        uint gridVersion)
 198    {
 346693199        ScanCellKey = scanCellKey;
 346693200        IsBoundaryVoxel = isBoundaryVoxel;
 201
 346693202        WorldIndex = worldVoxelIndex;
 346693203        WorldPosition = worldPosition;
 204
 346693205        CachedGridVersion = gridVersion;
 346693206        IsAllocated = true;
 346693207    }
 208
 209    /// <summary>
 210    /// Resets the voxel, clearing all allocated data and returning it to pools.
 211    /// </summary>
 212    internal void Reset(VoxelGrid? ownerGrid = null)
 213    {
 693333214        if (!IsAllocated)
 346659215            return;
 216
 346674217        RemovePartitions();
 346674218        ReleaseObstacleState(ownerGrid);
 346674219        ClearRuntimeState();
 346674220    }
 221
 222    private void RemovePartitions()
 223    {
 346674224        if (!_partitionProvider.IsEmpty)
 225        {
 18226            lock (_partitionLock)
 227            {
 18228                PartitionProvider<IVoxelPartition>.Enumerator partitions = _partitionProvider.GetEnumerator();
 45229                while (partitions.MoveNext())
 230                {
 27231                    IVoxelPartition partition = partitions.Current;
 232                    try
 233                    {
 27234                        partition.OnRemoveFromVoxel(this);
 26235                    }
 1236                    catch (Exception ex)
 237                    {
 1238                        GridForgeLogger.Channel.Error(
 1239                            $"Attempting to call {nameof(partition.OnRemoveFromVoxel)} on {partition.GetType().Name}: {e
 1240                    }
 241                }
 242
 18243                _partitionProvider.Clear();
 18244            }
 245        }
 346674246    }
 247
 248    private void ReleaseObstacleState(VoxelGrid? ownerGrid)
 249    {
 346674250        if (ownerGrid != null && ObstacleCount > 0)
 564251            ownerGrid.ClearObstacles(this);
 346110252        else if (ObstacleTracker != null)
 2253            SwiftHashSetPool<ObstacleToken>.Shared.Release(ObstacleTracker);
 254
 346674255        ObstacleTracker = null;
 346674256        ObstacleCount = 0;
 346674257    }
 258
 259    private void ClearRuntimeState()
 260    {
 346674261        IsBoundaryVoxel = false;
 262
 346674263        ScanCellKey = 0;
 346674264        WorldIndex = default;
 265
 346674266        OccupantCount = 0;
 346674267        _onObstacleAdded = null;
 346674268        _onObstacleRemoved = null;
 346674269        _onObstaclesCleared = null;
 346674270        _onOccupantAdded = null;
 346674271        _onOccupantRemoved = null;
 272
 346674273        IsAllocated = false;
 346674274    }
 275
 276    #endregion
 277
 278    #region Notifications
 279
 280    internal void NotifyObstacleAdded(ObstacleEventInfo eventInfo)
 281    {
 1026282        Action<ObstacleEventInfo>? handlers = _onObstacleAdded;
 1026283        if (handlers == null)
 1024284            return;
 285
 2286        var handlerDelegates = handlers.GetInvocationList();
 12287        for (int i = 0; i < handlerDelegates.Length; i++)
 288        {
 289            try
 290            {
 4291                ((Action<ObstacleEventInfo>)handlerDelegates[i])(eventInfo);
 2292            }
 2293            catch (Exception ex)
 294            {
 2295                GridForgeLogger.Channel.Error($"[Voxel {WorldIndex}] Obstacle add error: {ex.Message}");
 2296            }
 297        }
 2298    }
 299
 300    internal void NotifyObstacleRemoved(ObstacleEventInfo eventInfo)
 301    {
 89302        Action<ObstacleEventInfo>? handlers = _onObstacleRemoved;
 89303        if (handlers == null)
 88304            return;
 305
 1306        var handlerDelegates = handlers.GetInvocationList();
 6307        for (int i = 0; i < handlerDelegates.Length; i++)
 308        {
 309            try
 310            {
 2311                ((Action<ObstacleEventInfo>)handlerDelegates[i])(eventInfo);
 1312            }
 1313            catch (Exception ex)
 314            {
 1315                GridForgeLogger.Channel.Error($"[Voxel {WorldIndex}] Obstacle remove error: {ex.Message}");
 1316            }
 317        }
 1318    }
 319
 320    internal void NotifyObstaclesCleared(ObstacleClearEventInfo eventInfo)
 321    {
 4322        Action<ObstacleClearEventInfo>? handlers = _onObstaclesCleared;
 4323        if (handlers == null)
 3324            return;
 325
 1326        var handlerDelegates = handlers.GetInvocationList();
 6327        for (int i = 0; i < handlerDelegates.Length; i++)
 328        {
 329            try
 330            {
 2331                ((Action<ObstacleClearEventInfo>)handlerDelegates[i])(eventInfo);
 1332            }
 1333            catch (Exception ex)
 334            {
 1335                GridForgeLogger.Channel.Error($"[Voxel {WorldIndex}] Obstacle clear error: {ex.Message}");
 1336            }
 337        }
 1338    }
 339
 340    internal void NotifyOccupantAdded(OccupantEventInfo eventInfo)
 341    {
 768342        Action<OccupantEventInfo>? handlers = _onOccupantAdded;
 768343        if (handlers == null)
 767344            return;
 345
 1346        var handlerDelegates = handlers.GetInvocationList();
 6347        for (int i = 0; i < handlerDelegates.Length; i++)
 348        {
 349            try
 350            {
 2351                ((Action<OccupantEventInfo>)handlerDelegates[i])(eventInfo);
 1352            }
 1353            catch (Exception ex)
 354            {
 1355                GridForgeLogger.Channel.Error($"[Voxel {WorldIndex}] Occupant add error: {ex.Message}");
 1356            }
 357        }
 1358    }
 359
 360    internal void NotifyOccupantRemoved(OccupantEventInfo eventInfo)
 361    {
 158362        Action<OccupantEventInfo>? handlers = _onOccupantRemoved;
 158363        if (handlers == null)
 157364            return;
 365
 1366        var handlerDelegates = handlers.GetInvocationList();
 6367        for (int i = 0; i < handlerDelegates.Length; i++)
 368        {
 369            try
 370            {
 2371                ((Action<OccupantEventInfo>)handlerDelegates[i])(eventInfo);
 1372            }
 1373            catch (Exception ex)
 374            {
 1375                GridForgeLogger.Channel.Error($"[Voxel {WorldIndex}] Occupant remove error: {ex.Message}");
 1376            }
 377        }
 1378    }
 379
 380    #endregion
 381
 382    #region Partition Management
 383
 384    /// <summary>
 385    /// Adds a partition to this voxel, allowing specialized behaviors.
 386    /// </summary>
 387    public bool TryAddPartition(IVoxelPartition partition)
 388    {
 85389        if (partition == null)
 1390            return false;
 391
 84392        Type partitionType = partition.GetType();
 393
 84394        lock (_partitionLock)
 395        {
 84396            if (!_partitionProvider.TryAdd(partitionType, partition))
 2397                return false;
 82398        }
 399
 400        try
 401        {
 82402            partition.SetParentIndex(WorldIndex);
 82403            partition.OnAddToVoxel(this);
 81404            return true;
 405        }
 1406        catch (Exception ex)
 407        {
 1408            lock (_partitionLock)
 1409                _partitionProvider.TryRemove(partitionType, out _);
 410
 1411            string partitionName = partitionType.Name;
 1412            GridForgeLogger.Channel.Error($"Error attempting to attach partition {partitionName}: {ex.Message}");
 1413            return false;
 414        }
 84415    }
 416
 417    /// <summary>
 418    /// Removes a partition from this voxel.
 419    /// </summary>
 420    public bool TryRemovePartition<T>() where T : IVoxelPartition
 421    {
 59422        Type partitionType = typeof(T);
 423
 59424        IVoxelPartition? partition = null;
 59425        lock (_partitionLock)
 59426            _partitionProvider.TryRemove(partitionType, out partition);
 427
 59428        if (partition == null)
 429        {
 2430            string partitionName = partitionType.Name;
 2431            GridForgeLogger.Channel.Warn($"Partition {partitionName} not found on this voxel.");
 2432            return false;
 433        }
 434
 435        try
 436        {
 57437            partition.OnRemoveFromVoxel(this);
 56438        }
 1439        catch (Exception ex)
 440        {
 1441            string partitionName = partitionType.Name;
 1442            GridForgeLogger.Channel.Error($"Attempting to call {nameof(partition.OnRemoveFromVoxel)} on {partitionName}:
 1443        }
 444
 57445        return true;
 446    }
 447
 448    /// <summary>
 449    /// Checks whether or not this voxel contains a specific partition.
 450    /// </summary>
 451    [MethodImpl(MethodImplOptions.AggressiveInlining)]
 452    public bool HasPartition<T>() where T : IVoxelPartition
 453    {
 37454        return TryGetPartition<T>(out _);
 455    }
 456
 457    /// <summary>
 458    /// Retrieves a partition from the voxel by type.
 459    /// </summary>
 460    [MethodImpl(MethodImplOptions.AggressiveInlining)]
 461    public bool TryGetPartition<T>(out T? partition) where T : IVoxelPartition
 462    {
 1149463        lock (_partitionLock)
 464        {
 465            // Resolve the exact key through the existing provider without a
 466            // nested generic lookup. Keep typed materialization under the lock:
 467            // reset callbacks can mutate or pool payloads, including boxed structs.
 1149468            if (_partitionProvider.TryGet(typeof(T), out IVoxelPartition? candidate)
 1149469                && candidate is T typedPartition)
 470            {
 1088471                partition = typedPartition;
 1088472                return true;
 473            }
 474
 61475            partition = default;
 61476            return false;
 477        }
 1149478    }
 479
 480    /// <summary>
 481    /// Retrieves a partition from the voxel by type and returns null if it doesn't exist.
 482    /// </summary>
 483    [MethodImpl(MethodImplOptions.AggressiveInlining)]
 484    public T? GetPartitionOrDefault<T>() where T : class, IVoxelPartition
 485    {
 33486        return TryGetPartition(out T? partition) ? partition : null;
 487    }
 488
 489    #endregion
 490
 491    #region Neighbor Handling
 492
 493    /// <summary>
 494    /// Clears and fills caller-owned storage with neighboring voxels whose
 495    /// world-space voxel footprints touch this voxel's footprint.
 496    /// </summary>
 497    /// <param name="ownerGrid">The active grid that owns this voxel.</param>
 498    /// <param name="results">Caller-owned storage cleared and filled with contact neighbors.</param>
 499    /// <param name="scope">The grid groups included by the contact query.</param>
 500    /// <param name="tolerance">Optional fixed-point tolerance applied to footprint contact checks.</param>
 501    public void GetNeighborsInto(
 502        VoxelGrid ownerGrid,
 503        SwiftList<Voxel> results,
 504        VoxelNeighborScope scope = VoxelNeighborScope.All,
 505        Fixed64? tolerance = null)
 506    {
 31507        ChronicleGuard.ThrowIfNull(results, nameof(results));
 508
 31509        results.Clear();
 31510        if (!IsValidOwnerGrid(ownerGrid))
 1511            return;
 512
 30513        VoxelNeighborResolver.AddContactNeighbors(this, ownerGrid, results, scope, tolerance);
 30514    }
 515
 516    /// <summary>
 517    /// Determines whether this voxel has at least one footprint-contact neighbor in the requested scope.
 518    /// </summary>
 519    /// <param name="ownerGrid">The active grid that owns this voxel.</param>
 520    /// <param name="scope">The grid groups included by the contact query.</param>
 521    /// <param name="tolerance">Optional fixed-point tolerance applied to footprint contact checks.</param>
 522    /// <returns>True when at least one contact exists; otherwise false.</returns>
 523    public bool HasNeighbor(
 524        VoxelGrid ownerGrid,
 525        VoxelNeighborScope scope = VoxelNeighborScope.All,
 526        Fixed64? tolerance = null)
 527    {
 10528        if (!IsValidOwnerGrid(ownerGrid))
 1529            return false;
 530
 9531        return VoxelNeighborResolver.HasContactNeighbor(this, ownerGrid, scope, tolerance);
 532    }
 533
 534    /// <summary>
 535    /// Retrieves the rectangular-prism neighbor voxel in the supplied topology-local direction.
 536    /// </summary>
 537    /// <param name="ownerGrid">The active grid that owns this voxel.</param>
 538    /// <param name="direction">The rectangular-prism direction to resolve.</param>
 539    /// <param name="neighbor">The resolved same-topology neighbor when found.</param>
 540    /// <returns>True when a same-topology neighbor exists in the supplied direction; otherwise false.</returns>
 541    public bool TryGetNeighbor(
 542        VoxelGrid ownerGrid,
 543        RectangularDirection direction,
 544        out Voxel? neighbor)
 545    {
 75546        neighbor = null;
 75547        if (!IsValidOwnerGrid(ownerGrid))
 4548            return false;
 549
 71550        return VoxelNeighborResolver.TryGetNeighbor(this, ownerGrid, direction, out neighbor);
 551    }
 552
 553    /// <summary>
 554    /// Retrieves the hex-prism neighbor voxel in the supplied topology-local direction.
 555    /// </summary>
 556    /// <param name="ownerGrid">The active grid that owns this voxel.</param>
 557    /// <param name="direction">The hex-prism direction to resolve.</param>
 558    /// <param name="neighbor">The resolved same-topology neighbor when found.</param>
 559    /// <returns>True when a same-topology neighbor exists in the supplied direction; otherwise false.</returns>
 560    public bool TryGetNeighbor(
 561        VoxelGrid ownerGrid,
 562        HexDirection direction,
 563        out Voxel? neighbor)
 564    {
 6565        neighbor = null;
 6566        if (!IsValidOwnerGrid(ownerGrid))
 1567            return false;
 568
 5569        return VoxelNeighborResolver.TryGetNeighbor(this, ownerGrid, direction, out neighbor);
 570    }
 571
 572    /// <summary>
 573    /// Clears and fills caller-owned storage with rectangular-prism neighbors in deterministic direction order.
 574    /// </summary>
 575    /// <param name="ownerGrid">The active grid that owns this voxel.</param>
 576    /// <param name="results">Caller-owned storage cleared and filled with direction-labeled neighbors.</param>
 577    public void GetRectangularNeighborsInto(
 578        VoxelGrid ownerGrid,
 579        SwiftList<(RectangularDirection Direction, Voxel Voxel)> results)
 580    {
 9581        ChronicleGuard.ThrowIfNull(results, nameof(results));
 582
 9583        results.Clear();
 9584        if (!IsValidOwnerGrid(ownerGrid))
 1585            return;
 586
 8587        VoxelNeighborResolver.AddRectangularNeighbors(this, ownerGrid, results);
 8588    }
 589
 590    /// <summary>
 591    /// Clears and fills caller-owned storage with hex-prism neighbors in deterministic direction order.
 592    /// </summary>
 593    /// <param name="ownerGrid">The active grid that owns this voxel.</param>
 594    /// <param name="results">Caller-owned storage cleared and filled with direction-labeled neighbors.</param>
 595    public void GetHexNeighborsInto(
 596        VoxelGrid ownerGrid,
 597        SwiftList<(HexDirection Direction, Voxel Voxel)> results)
 598    {
 4599        ChronicleGuard.ThrowIfNull(results, nameof(results));
 600
 4601        results.Clear();
 4602        if (!IsValidOwnerGrid(ownerGrid))
 1603            return;
 604
 3605        VoxelNeighborResolver.AddHexNeighbors(this, ownerGrid, results);
 3606    }
 607
 608    private bool IsValidOwnerGrid(VoxelGrid? ownerGrid)
 609    {
 135610        return ownerGrid != null
 135611            && ownerGrid.IsActive
 135612            && ownerGrid.GridIndex == WorldIndex.GridIndex
 135613            && ownerGrid.SpawnToken == WorldIndex.GridSpawnToken
 135614            && ownerGrid.World != null
 135615            && ownerGrid.World.SpawnToken == WorldIndex.WorldSpawnToken;
 616    }
 617
 618    #endregion
 619
 620    #region Utility
 621
 622    /// <inheritdoc/>
 3255623    public override int GetHashCode() => RuntimeHelpers.GetHashCode(this);
 624
 625    /// <inheritdoc/>
 1626    public override string ToString() => WorldIndex.ToString();
 627
 628    /// <inheritdoc/>
 456629    public bool Equals(Voxel? other) => ReferenceEquals(this, other);
 630
 631    /// <inheritdoc/>
 2632    public override bool Equals(object? obj) => ReferenceEquals(this, obj);
 633
 634    #endregion
 635}

Methods/Properties

get_GridIndex()
get_Index()
.ctor()
get_IsPartioned()
get_IsBlocked()
get_IsBlockable()
get_IsOccupied()
get_HasVacancy()
get_HasEventSubscribers()
add_OnObstacleAdded(System.Action`1<GridForge.Grids.ObstacleEventInfo>)
remove_OnObstacleAdded(System.Action`1<GridForge.Grids.ObstacleEventInfo>)
add_OnObstacleRemoved(System.Action`1<GridForge.Grids.ObstacleEventInfo>)
remove_OnObstacleRemoved(System.Action`1<GridForge.Grids.ObstacleEventInfo>)
add_OnObstaclesCleared(System.Action`1<GridForge.Grids.ObstacleClearEventInfo>)
remove_OnObstaclesCleared(System.Action`1<GridForge.Grids.ObstacleClearEventInfo>)
add_OnOccupantAdded(System.Action`1<GridForge.Grids.OccupantEventInfo>)
remove_OnOccupantAdded(System.Action`1<GridForge.Grids.OccupantEventInfo>)
add_OnOccupantRemoved(System.Action`1<GridForge.Grids.OccupantEventInfo>)
remove_OnOccupantRemoved(System.Action`1<GridForge.Grids.OccupantEventInfo>)
Initialize(GridForge.Spatial.WorldVoxelIndex,FixedMathSharp.Vector3d,System.Int32,System.Boolean,System.UInt32)
Reset(GridForge.Grids.VoxelGrid)
RemovePartitions()
ReleaseObstacleState(GridForge.Grids.VoxelGrid)
ClearRuntimeState()
NotifyObstacleAdded(GridForge.Grids.ObstacleEventInfo)
NotifyObstacleRemoved(GridForge.Grids.ObstacleEventInfo)
NotifyObstaclesCleared(GridForge.Grids.ObstacleClearEventInfo)
NotifyOccupantAdded(GridForge.Grids.OccupantEventInfo)
NotifyOccupantRemoved(GridForge.Grids.OccupantEventInfo)
TryAddPartition(GridForge.Spatial.IVoxelPartition)
TryRemovePartition()
HasPartition()
TryGetPartition(T&)
GetPartitionOrDefault()
GetNeighborsInto(GridForge.Grids.VoxelGrid,SwiftCollections.SwiftList`1<GridForge.Grids.Voxel>,GridForge.Spatial.VoxelNeighborScope,System.Nullable`1<FixedMathSharp.Fixed64>)
HasNeighbor(GridForge.Grids.VoxelGrid,GridForge.Spatial.VoxelNeighborScope,System.Nullable`1<FixedMathSharp.Fixed64>)
TryGetNeighbor(GridForge.Grids.VoxelGrid,GridForge.Spatial.RectangularDirection,GridForge.Grids.Voxel&)
TryGetNeighbor(GridForge.Grids.VoxelGrid,GridForge.Spatial.HexDirection,GridForge.Grids.Voxel&)
GetRectangularNeighborsInto(GridForge.Grids.VoxelGrid,SwiftCollections.SwiftList`1<System.ValueTuple`2<GridForge.Spatial.RectangularDirection,GridForge.Grids.Voxel>>)
GetHexNeighborsInto(GridForge.Grids.VoxelGrid,SwiftCollections.SwiftList`1<System.ValueTuple`2<GridForge.Spatial.HexDirection,GridForge.Grids.Voxel>>)
IsValidOwnerGrid(GridForge.Grids.VoxelGrid)
GetHashCode()
ToString()
Equals(GridForge.Grids.Voxel)
Equals(System.Object)