aboutsummaryrefslogtreecommitdiff
path: root/Map/Presentation/Base Components/MapRender
diff options
context:
space:
mode:
Diffstat (limited to 'Map/Presentation/Base Components/MapRender')
-rw-r--r--Map/Presentation/Base Components/MapRender/MapAxes.swift54
-rw-r--r--Map/Presentation/Base Components/MapRender/MapBlockers.swift26
-rw-r--r--Map/Presentation/Base Components/MapRender/MapEdges.swift26
-rw-r--r--Map/Presentation/Base Components/MapRender/MapGroup.swift24
-rw-r--r--Map/Presentation/Base Components/MapRender/MapGroups.swift26
-rw-r--r--Map/Presentation/Base Components/MapRender/MapNotes.swift30
-rw-r--r--Map/Presentation/Base Components/MapRender/MapOpportunities.swift26
-rw-r--r--Map/Presentation/Base Components/MapRender/MapStages.swift42
-rw-r--r--Map/Presentation/Base Components/MapRender/MapVertices.swift30
9 files changed, 133 insertions, 151 deletions
diff --git a/Map/Presentation/Base Components/MapRender/MapAxes.swift b/Map/Presentation/Base Components/MapRender/MapAxes.swift
index bdbafbd..4f64135 100644
--- a/Map/Presentation/Base Components/MapRender/MapAxes.swift
+++ b/Map/Presentation/Base Components/MapRender/MapAxes.swift
@@ -1,19 +1,17 @@
-/*
- Copyright (C) 2024 Rubén Beltrán del Río
+// Copyright (C) 2024 Rubén Beltrán del Río
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program. If not, see https://map.tranquil.systems.
- */
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see https://map.tranquil.systems.
import SwiftUI
struct MapAxes: View {
@@ -35,14 +33,14 @@ struct MapAxes: View {
path.addLine(to: CGPoint(x: mapSize.width, y: mapSize.height))
path.move(to: CGPoint(x: mapSize.width, y: mapSize.height))
path.closeSubpath()
- }.stroke(Color.map.axisColor, lineWidth: lineWidth * 2)
+ }.stroke(Color.Map.axisColor, lineWidth: lineWidth * 2)
// Y Labels
- Text("Visible").font(.theme.axisLabel).foregroundColor(.map.labelColor).rotationEffect(
+ Text("Visible").font(.Theme.axisLabel).foregroundColor(.Map.labelColor).rotationEffect(
Angle(degrees: -90.0)
)
.offset(CGSize(width: -35.0, height: 0.0))
- Text("Invisible").font(.theme.axisLabel).foregroundColor(.map.labelColor).rotationEffect(
+ Text("Invisible").font(.Theme.axisLabel).foregroundColor(.Map.labelColor).rotationEffect(
Angle(degrees: -90.0)
)
.offset(CGSize(width: -40.0, height: mapSize.height - 20))
@@ -50,37 +48,37 @@ struct MapAxes: View {
// X Labels
Text("Uncharted")
- .font(.theme.axisLabel)
- .foregroundColor(.map.labelColor)
+ .font(.Theme.axisLabel)
+ .foregroundColor(.Map.labelColor)
.frame(width: mapSize.width / 4, height: stageHeight / 2.0, alignment: .topLeading)
.offset(CGSize(width: 0.0, height: -stageHeight / 4.0))
Text("Industrialised")
- .font(.theme.axisLabel)
- .foregroundColor(.map.labelColor)
+ .font(.Theme.axisLabel)
+ .foregroundColor(.Map.labelColor)
.frame(width: mapSize.width / 4, height: stageHeight / 2.0, alignment: .topLeading)
.offset(CGSize(width: mapSize.width - 100.0, height: -stageHeight / 4.0))
Text(evolution.i)
- .font(.theme.axisLabel)
- .foregroundColor(.map.labelColor)
+ .font(.Theme.axisLabel)
+ .foregroundColor(.Map.labelColor)
.frame(width: w(stages[0]), height: stageHeight, alignment: .topLeading)
.offset(CGSize(width: 0.0, height: mapSize.height + padding))
Text(evolution.ii)
- .font(.theme.axisLabel)
- .foregroundColor(.map.labelColor)
+ .font(.Theme.axisLabel)
+ .foregroundColor(.Map.labelColor)
.frame(width: w(stages[1]) - w(stages[0]), height: stageHeight, alignment: .topLeading)
.offset(CGSize(width: w(stages[0]), height: mapSize.height + padding))
Text(evolution.iii)
- .font(.theme.axisLabel)
- .foregroundColor(.map.labelColor)
+ .font(.Theme.axisLabel)
+ .foregroundColor(.Map.labelColor)
.frame(width: w(stages[2]) - w(stages[1]), height: stageHeight, alignment: .topLeading)
.offset(CGSize(width: w(stages[1]), height: mapSize.height + padding))
Text(evolution.iv)
- .font(.theme.axisLabel)
- .foregroundColor(.map.labelColor)
+ .font(.Theme.axisLabel)
+ .foregroundColor(.Map.labelColor)
.frame(width: mapSize.width - w(stages[2]), height: stageHeight, alignment: .topLeading)
.offset(CGSize(width: w(stages[2]), height: mapSize.height + padding))
}
diff --git a/Map/Presentation/Base Components/MapRender/MapBlockers.swift b/Map/Presentation/Base Components/MapRender/MapBlockers.swift
index 356c1d1..613b792 100644
--- a/Map/Presentation/Base Components/MapRender/MapBlockers.swift
+++ b/Map/Presentation/Base Components/MapRender/MapBlockers.swift
@@ -1,19 +1,17 @@
-/*
- Copyright (C) 2024 Rubén Beltrán del Río
+// Copyright (C) 2024 Rubén Beltrán del Río
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program. If not, see https://map.tranquil.systems.
- */
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see https://map.tranquil.systems.
import SwiftUI
struct MapBlockers: View {
@@ -34,7 +32,7 @@ struct MapBlockers: View {
y: h(vertex.position.y) - vertexSize.height * 2 / 3),
size: CGSize(width: vertexSize.width / 2, height: vertexSize.height * 2)
), cornerSize: cornerSize)
- }.fill(Color.map.blockerColor)
+ }.fill(Color.Map.blockerColor)
}
}
diff --git a/Map/Presentation/Base Components/MapRender/MapEdges.swift b/Map/Presentation/Base Components/MapRender/MapEdges.swift
index a377774..3090c04 100644
--- a/Map/Presentation/Base Components/MapRender/MapEdges.swift
+++ b/Map/Presentation/Base Components/MapRender/MapEdges.swift
@@ -1,19 +1,17 @@
-/*
- Copyright (C) 2024 Rubén Beltrán del Río
+// Copyright (C) 2024 Rubén Beltrán del Río
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program. If not, see https://map.tranquil.systems.
- */
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see https://map.tranquil.systems.
import SwiftUI
struct MapEdges: View {
@@ -68,7 +66,7 @@ struct MapEdges: View {
path.closeSubpath()
}.applying(
CGAffineTransform(translationX: vertexSize.width / 2.0, y: vertexSize.height / 2.0)
- ).stroke(Color.map.vertexColor, lineWidth: lineWidth)
+ ).stroke(Color.Map.vertexColor, lineWidth: lineWidth)
}
}
diff --git a/Map/Presentation/Base Components/MapRender/MapGroup.swift b/Map/Presentation/Base Components/MapRender/MapGroup.swift
index 852c536..a5877a8 100644
--- a/Map/Presentation/Base Components/MapRender/MapGroup.swift
+++ b/Map/Presentation/Base Components/MapRender/MapGroup.swift
@@ -1,19 +1,17 @@
-/*
- Copyright (C) 2024 Rubén Beltrán del Río
+// Copyright (C) 2024 Rubén Beltrán del Río
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program. If not, see https://map.tranquil.systems.
- */
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see https://map.tranquil.systems.
import ConcaveHull
import SwiftUI
diff --git a/Map/Presentation/Base Components/MapRender/MapGroups.swift b/Map/Presentation/Base Components/MapRender/MapGroups.swift
index 936a1fc..41ea147 100644
--- a/Map/Presentation/Base Components/MapRender/MapGroups.swift
+++ b/Map/Presentation/Base Components/MapRender/MapGroups.swift
@@ -1,19 +1,17 @@
-/*
- Copyright (C) 2024 Rubén Beltrán del Río
+// Copyright (C) 2024 Rubén Beltrán del Río
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program. If not, see https://map.tranquil.systems.
- */
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see https://map.tranquil.systems.
import ConcaveHull
import SwiftUI
@@ -30,7 +28,7 @@ struct MapGroups: View {
}
private func color(_ index: Int) -> Color {
- return .map.groupColors[index % Color.map.groupColors.count]
+ return .Map.groupColors[index % Color.Map.groupColors.count]
}
}
diff --git a/Map/Presentation/Base Components/MapRender/MapNotes.swift b/Map/Presentation/Base Components/MapRender/MapNotes.swift
index d2d7e1f..0119154 100644
--- a/Map/Presentation/Base Components/MapRender/MapNotes.swift
+++ b/Map/Presentation/Base Components/MapRender/MapNotes.swift
@@ -1,19 +1,17 @@
-/*
- Copyright (C) 2024 Rubén Beltrán del Río
+// Copyright (C) 2024 Rubén Beltrán del Río
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program. If not, see https://map.tranquil.systems.
- */
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see https://map.tranquil.systems.
import SwiftUI
struct MapNotes: View {
@@ -26,11 +24,11 @@ struct MapNotes: View {
var body: some View {
ForEach(notes, id: \.id) { note in
- Text(note.text.replacingOccurrences(of: "\\n", with: "\n")).font(.theme.note)
+ Text(note.text.replacingOccurrences(of: "\\n", with: "\n")).font(.Theme.note)
.padding(2.0)
.background(.white)
- .foregroundColor(.map.labelColor)
- .border(Color.map.vertexColor, width: lineWidth)
+ .foregroundColor(.Map.labelColor)
+ .border(Color.Map.vertexColor, width: lineWidth)
.frame(minWidth: 16.0, maxWidth: maxWidth, alignment: .topLeading)
.offset(
CGSize(
diff --git a/Map/Presentation/Base Components/MapRender/MapOpportunities.swift b/Map/Presentation/Base Components/MapRender/MapOpportunities.swift
index 310379b..3d539d4 100644
--- a/Map/Presentation/Base Components/MapRender/MapOpportunities.swift
+++ b/Map/Presentation/Base Components/MapRender/MapOpportunities.swift
@@ -1,19 +1,17 @@
-/*
- Copyright (C) 2024 Rubén Beltrán del Río
+// Copyright (C) 2024 Rubén Beltrán del Río
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program. If not, see https://map.tranquil.systems.
- */
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see https://map.tranquil.systems.
import SwiftUI
struct MapOpportunities: View {
@@ -63,7 +61,7 @@ struct MapOpportunities: View {
}.applying(
CGAffineTransform(translationX: vertexSize.width / 2.0, y: vertexSize.height / 2.0)
).strokedPath(StrokeStyle(lineWidth: lineWidth / 4, dash: [10.0])).stroke(
- Color.map.opportunityColor)
+ Color.Map.opportunityColor)
}
}
diff --git a/Map/Presentation/Base Components/MapRender/MapStages.swift b/Map/Presentation/Base Components/MapRender/MapStages.swift
index 754ebb2..d5e5965 100644
--- a/Map/Presentation/Base Components/MapRender/MapStages.swift
+++ b/Map/Presentation/Base Components/MapRender/MapStages.swift
@@ -1,19 +1,17 @@
-/*
- Copyright (C) 2024 Rubén Beltrán del Río
+// Copyright (C) 2024 Rubén Beltrán del Río
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program. If not, see https://map.tranquil.systems.
- */
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see https://map.tranquil.systems.
import Patterns
import SwiftUI
@@ -27,25 +25,25 @@ struct MapStages: View {
var body: some View {
ZStack(alignment: .topLeading) {
PatternView(
- design: .constant(.stitch), pixelSize: 1.0, foregroundColor: .map.stageForeground,
- backgroundColor: .map.stageBackground
+ design: .constant(.stitch), pixelSize: 1.0, foregroundColor: .Map.stageForeground,
+ backgroundColor: .Map.stageBackground
)
.frame(width: w(stages[0]), height: mapSize.height)
PatternView(
- design: .constant(.shingles), pixelSize: 1.0, foregroundColor: .map.stageForeground,
- backgroundColor: .map.stageBackground
+ design: .constant(.shingles), pixelSize: 1.0, foregroundColor: .Map.stageForeground,
+ backgroundColor: .Map.stageBackground
)
.offset(CGSize(width: w(stages[0]), height: 0))
.frame(width: w(stages[1]) - w(stages[0]), height: mapSize.height)
PatternView(
- design: .constant(.shadowGrid), pixelSize: 1.0, foregroundColor: .map.stageForeground,
- backgroundColor: .map.stageBackground
+ design: .constant(.shadowGrid), pixelSize: 1.0, foregroundColor: .Map.stageForeground,
+ backgroundColor: .Map.stageBackground
)
.offset(CGSize(width: w(stages[1]), height: 0))
.frame(width: w(stages[2]) - w(stages[1]), height: mapSize.height)
PatternView(
- design: .constant(.wicker), pixelSize: 1.0, foregroundColor: .map.stageForeground,
- backgroundColor: .map.stageBackground
+ design: .constant(.wicker), pixelSize: 1.0, foregroundColor: .Map.stageForeground,
+ backgroundColor: .Map.stageBackground
)
.offset(CGSize(width: w(stages[2]), height: 0))
.frame(width: mapSize.width - w(stages[2]), height: mapSize.height)
@@ -63,7 +61,7 @@ struct MapStages: View {
path.move(to: CGPoint(x: w(stages[0]), y: 0))
path.closeSubpath()
}.strokedPath(StrokeStyle(lineWidth: lineWidth / 4, dash: [10.0, 18.0])).stroke(
- Color.map.axisColor)
+ Color.Map.axisColor)
}
}
diff --git a/Map/Presentation/Base Components/MapRender/MapVertices.swift b/Map/Presentation/Base Components/MapRender/MapVertices.swift
index 1be091a..d8e3b88 100644
--- a/Map/Presentation/Base Components/MapRender/MapVertices.swift
+++ b/Map/Presentation/Base Components/MapRender/MapVertices.swift
@@ -1,19 +1,17 @@
-/*
- Copyright (C) 2024 Rubén Beltrán del Río
+// Copyright (C) 2024 Rubén Beltrán del Río
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
+// This program is free software: you can redistribute it and/or modify
+// it under the terms of the GNU General Public License as published by
+// the Free Software Foundation, either version 3 of the License, or
+// (at your option) any later version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+// GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program. If not, see https://map.tranquil.systems.
- */
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see https://map.tranquil.systems.
import SwiftUI
struct MapVertices: View {
@@ -29,9 +27,9 @@ struct MapVertices: View {
ZStack(alignment: .topLeading) {
ForEach(vertices, id: \.id) { vertex in
ZStack(alignment: .topLeading) {
- getVertexShape(vertex).fill(Color.map.vertexColor)
- Text(vertex.label.replacingOccurrences(of: "\\n", with: "\n")).font(.theme.vertexLabel)
- .foregroundColor(.map.labelColor)
+ getVertexShape(vertex).fill(Color.Map.vertexColor)
+ Text(vertex.label.replacingOccurrences(of: "\\n", with: "\n")).font(.Theme.vertexLabel)
+ .foregroundColor(.Map.labelColor)
.shadow(color: .white, radius: 0, x: -0.5, y: -0.5)
.shadow(color: .white, radius: 0, x: 0.5, y: 0.5)
.offset(