| | | 1 | | namespace Trailblazer.Pathing; |
| | | 2 | | |
| | | 3 | | /// <summary> |
| | | 4 | | /// Represents a single cell parsed from the source map of a <see cref="TraversalAuthoringMap"/>, |
| | | 5 | | /// including its interpreted legend entry and whether it was explicitly marked for transition generation. |
| | | 6 | | /// This is an internal struct used during the build process of a traversal chart. |
| | | 7 | | /// </summary> |
| | | 8 | | internal readonly struct ParsedTraversalCell |
| | | 9 | | { |
| | | 10 | | public ParsedTraversalCell(TraversalLegendEntry entry, bool hasTransitionMarker, int pathCostModifier = 0) |
| | | 11 | | { |
| | 119 | 12 | | Entry = entry; |
| | 119 | 13 | | HasTransitionMarker = hasTransitionMarker; |
| | 119 | 14 | | PathCostModifier = pathCostModifier; |
| | 119 | 15 | | } |
| | | 16 | | |
| | | 17 | | public TraversalLegendEntry Entry { get; } |
| | | 18 | | |
| | | 19 | | public bool HasTransitionMarker { get; } |
| | | 20 | | |
| | | 21 | | /// <summary> |
| | | 22 | | /// An inline path cost modifier parsed from the token suffix (e.g. <c>S_60</c> yields 60). |
| | | 23 | | /// Zero when no suffix was present or when the entry is a skip cell. |
| | | 24 | | /// </summary> |
| | | 25 | | public int PathCostModifier { get; } |
| | | 26 | | |
| | 47 | 27 | | public bool CanGenerateTransition => TransitionMedia != TraversalMedia.None; |
| | | 28 | | |
| | 87 | 29 | | public TraversalMedia TransitionMedia => HasTransitionMarker |
| | 87 | 30 | | ? Entry.TransitionMedia |
| | 87 | 31 | | : TraversalMedia.None; |
| | | 32 | | } |