| | | 1 | | using GridForge.Spatial; |
| | | 2 | | |
| | | 3 | | namespace GridForge.Grids; |
| | | 4 | | |
| | | 5 | | /// <summary> |
| | | 6 | | /// Immutable snapshot describing an occupant mutation on a voxel. |
| | | 7 | | /// </summary> |
| | | 8 | | public readonly struct OccupantEventInfo |
| | | 9 | | { |
| | | 10 | | /// <summary> |
| | | 11 | | /// The voxel affected by the occupant mutation. |
| | | 12 | | /// </summary> |
| | | 13 | | public readonly WorldVoxelIndex VoxelIndex; |
| | | 14 | | |
| | | 15 | | /// <summary> |
| | | 16 | | /// The occupant that was added to or removed from the voxel. |
| | | 17 | | /// </summary> |
| | | 18 | | public readonly IVoxelOccupant Occupant; |
| | | 19 | | |
| | | 20 | | /// <summary> |
| | | 21 | | /// The scan-cell ticket assigned to the occupant for this voxel. |
| | | 22 | | /// </summary> |
| | | 23 | | public readonly int Ticket; |
| | | 24 | | |
| | | 25 | | /// <summary> |
| | | 26 | | /// The number of occupants on the voxel after the mutation completes. |
| | | 27 | | /// </summary> |
| | | 28 | | public readonly byte OccupantCount; |
| | | 29 | | |
| | | 30 | | /// <summary> |
| | | 31 | | /// The grid index containing <see cref="VoxelIndex"/>. |
| | | 32 | | /// </summary> |
| | 1 | 33 | | public readonly ushort GridIndex => VoxelIndex.GridIndex; |
| | | 34 | | |
| | | 35 | | /// <summary> |
| | | 36 | | /// Initializes a new immutable occupant mutation snapshot. |
| | | 37 | | /// </summary> |
| | | 38 | | public OccupantEventInfo( |
| | | 39 | | WorldVoxelIndex voxelIndex, |
| | | 40 | | IVoxelOccupant occupant, |
| | | 41 | | int ticket, |
| | | 42 | | byte occupantCount) |
| | | 43 | | { |
| | 461 | 44 | | VoxelIndex = voxelIndex; |
| | 461 | 45 | | Occupant = occupant; |
| | 461 | 46 | | Ticket = ticket; |
| | 461 | 47 | | OccupantCount = occupantCount; |
| | 461 | 48 | | } |
| | | 49 | | } |