| | | 1 | | //======================================================================= |
| | | 2 | | // GridCommittedChange.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 | | |
| | | 8 | | namespace GridForge.Grids; |
| | | 9 | | |
| | | 10 | | |
| | | 11 | | |
| | | 12 | | internal readonly struct GridCommittedChange |
| | | 13 | | { |
| | | 14 | | public readonly GridEventInfo GridEvent; |
| | | 15 | | public readonly GridExactChangeKind ExactKind; |
| | | 16 | | public readonly ObstacleEventInfo ObstacleEvent; |
| | | 17 | | public readonly ObstacleClearEventInfo ObstacleClearEvent; |
| | | 18 | | public readonly Voxel? TargetVoxel; |
| | | 19 | | |
| | | 20 | | public GridCommittedChange(GridEventInfo gridEvent) |
| | | 21 | | { |
| | 2675 | 22 | | GridEvent = gridEvent; |
| | 2675 | 23 | | ExactKind = GridExactChangeKind.None; |
| | 2675 | 24 | | ObstacleEvent = default; |
| | 2675 | 25 | | ObstacleClearEvent = default; |
| | 2675 | 26 | | TargetVoxel = null; |
| | 2675 | 27 | | } |
| | | 28 | | |
| | | 29 | | public GridCommittedChange( |
| | | 30 | | GridEventInfo gridEvent, |
| | | 31 | | GridExactChangeKind exactKind, |
| | | 32 | | ObstacleEventInfo obstacleEvent, |
| | | 33 | | Voxel targetVoxel) |
| | | 34 | | { |
| | 1117 | 35 | | GridEvent = gridEvent; |
| | 1117 | 36 | | ExactKind = exactKind; |
| | 1117 | 37 | | ObstacleEvent = obstacleEvent; |
| | 1117 | 38 | | ObstacleClearEvent = default; |
| | 1117 | 39 | | TargetVoxel = targetVoxel; |
| | 1117 | 40 | | } |
| | | 41 | | |
| | | 42 | | public GridCommittedChange( |
| | | 43 | | GridEventInfo gridEvent, |
| | | 44 | | ObstacleClearEventInfo obstacleClearEvent, |
| | | 45 | | Voxel targetVoxel) |
| | | 46 | | { |
| | 567 | 47 | | GridEvent = gridEvent; |
| | 567 | 48 | | ExactKind = GridExactChangeKind.ObstaclesCleared; |
| | 567 | 49 | | ObstacleEvent = default; |
| | 567 | 50 | | ObstacleClearEvent = obstacleClearEvent; |
| | 567 | 51 | | TargetVoxel = targetVoxel; |
| | 567 | 52 | | } |
| | | 53 | | } |