| 1234567891011121314151617181920 |
- namespace Day23;
- public record PathEdge(PathNode Start, PathNode End, List<Tile> Tiles)
- {
- private static int _count = 0;
- private PathEdge? _inverted;
-
- public int Id { get; private set; } = ++_count;
- public PathEdge Invert()
- {
- if (_inverted == null)
- {
- _inverted = new PathEdge(End, Start, Enumerable.Reverse(Tiles).ToList()) { _inverted = this };
- }
- return _inverted;
- }
- }
|