diff options
| author | Ruben Beltran del Rio <git@r.bdr.sh> | 2025-07-07 13:51:43 +0200 |
|---|---|---|
| committer | Ruben Beltran del Rio <git@r.bdr.sh> | 2025-07-07 13:51:43 +0200 |
| commit | 3bacbf6ac85330d35493953d7296e5ba420b7750 (patch) | |
| tree | be3e09b66d2567d5cc78798c47a45a039b534b02 /Map/Business/MapParser/MapParser.swift | |
| parent | a1a485f16e0f1720f2dcdf7ab03d52c29fe9e252 (diff) | |
Use inertia instead of blockers
Diffstat (limited to 'Map/Business/MapParser/MapParser.swift')
| -rw-r--r-- | Map/Business/MapParser/MapParser.swift | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/Map/Business/MapParser/MapParser.swift b/Map/Business/MapParser/MapParser.swift index e94de77..fc11415 100644 --- a/Map/Business/MapParser/MapParser.swift +++ b/Map/Business/MapParser/MapParser.swift @@ -22,7 +22,7 @@ struct MapParser { AnyMapParserStrategy(NoteParserStrategy()), AnyMapParserStrategy(VertexParserStrategy()), AnyMapParserStrategy(EdgeParserStrategy()), - AnyMapParserStrategy(BlockerParserStrategy()), + AnyMapParserStrategy(InertiaParserStrategy()), AnyMapParserStrategy(OpportunityParserStrategy()), AnyMapParserStrategy(StageParserStrategy()), AnyMapParserStrategy(GroupParserStrategy()), @@ -55,8 +55,8 @@ struct MapParsingPatterns { options: [.caseInsensitive, .anchorsMatchLines]) static let edge = try! NSRegularExpression( pattern: "^(.+?)[\\s]*-([->])[\\s]*(.+)", options: [.caseInsensitive, .anchorsMatchLines]) - static let blocker = try! NSRegularExpression( - pattern: "^\\[(Blocker)\\][\\s]*(.+)", options: [.caseInsensitive, .anchorsMatchLines]) + static let inertia = try! NSRegularExpression( + pattern: "^\\[(Inertia)\\][\\s]*(.+)", options: [.caseInsensitive, .anchorsMatchLines]) static let opportunity = try! NSRegularExpression( pattern: "^\\[(Evolution)\\][\\s]*(.+)[\\s]+([-+])[\\s]*([0-9]+.?[0-9]*)", options: [.caseInsensitive, .anchorsMatchLines]) @@ -74,14 +74,14 @@ struct MapParsingPatterns { struct ParsedMap { let vertices: [Vertex] let edges: [MapEdge] - let blockers: [Blocker] + let inertias: [Inertia] let opportunities: [Opportunity] let notes: [Note] let stages: [CGFloat] let groups: [[Vertex]] static let empty: ParsedMap = ParsedMap( - vertices: [], edges: [], blockers: [], opportunities: [], notes: [], stages: defaultDimensions, + vertices: [], edges: [], inertias: [], opportunities: [], notes: [], stages: defaultDimensions, groups: []) } @@ -112,7 +112,7 @@ struct MapEdge { let arrowhead: Bool } -struct Blocker { +struct Inertia { let id: Int let position: CGPoint } @@ -162,7 +162,7 @@ struct AnyMapParserStrategy: MapParserStrategy { class MapBuilder { var vertices: [String: Vertex] = [:] private var edges: [MapEdge] = [] - private var blockers: [Blocker] = [] + private var inertias: [Inertia] = [] private var opportunities: [Opportunity] = [] private var notes: [Note] = [] private var stages: [CGFloat] = defaultDimensions @@ -179,9 +179,9 @@ class MapBuilder { edges.append(edge) } - if type == Blocker.self { - let blocker = object as! Blocker - blockers.append(blocker) + if type == Inertia.self { + let inertia = object as! Inertia + inertias.append(inertia) } if type == Opportunity.self { @@ -208,7 +208,7 @@ class MapBuilder { func build() -> ParsedMap { let mappedVertices = vertices.map { label, vertex in return vertex } return ParsedMap( - vertices: mappedVertices, edges: edges, blockers: blockers, opportunities: opportunities, + vertices: mappedVertices, edges: edges, inertias: inertias, opportunities: opportunities, notes: notes, stages: stages, groups: groups) } |