aboutsummaryrefslogtreecommitdiff
path: root/Sources/WmapParser/DataStructures
diff options
context:
space:
mode:
Diffstat (limited to 'Sources/WmapParser/DataStructures')
-rw-r--r--Sources/WmapParser/DataStructures/Component.swift8
-rw-r--r--Sources/WmapParser/DataStructures/Dependency.swift8
-rw-r--r--Sources/WmapParser/DataStructures/Evolution.swift7
-rw-r--r--Sources/WmapParser/DataStructures/Group.swift6
-rw-r--r--Sources/WmapParser/DataStructures/Inertia.swift6
-rw-r--r--Sources/WmapParser/DataStructures/Map.swift12
-rw-r--r--Sources/WmapParser/DataStructures/MapPoint.swift7
-rw-r--r--Sources/WmapParser/DataStructures/Note.swift7
-rw-r--r--Sources/WmapParser/DataStructures/Shape.swift10
-rw-r--r--Sources/WmapParser/DataStructures/Stage.swift7
-rw-r--r--Sources/WmapParser/DataStructures/StageNumber.swift10
11 files changed, 88 insertions, 0 deletions
diff --git a/Sources/WmapParser/DataStructures/Component.swift b/Sources/WmapParser/DataStructures/Component.swift
new file mode 100644
index 0000000..5ef2716
--- /dev/null
+++ b/Sources/WmapParser/DataStructures/Component.swift
@@ -0,0 +1,8 @@
+extension WmapParser {
+ /// A component in the map.
+ public struct Component: Sendable, Equatable {
+ public let label: String
+ public let coordinates: MapPoint
+ public let shape: Shape
+ }
+}
diff --git a/Sources/WmapParser/DataStructures/Dependency.swift b/Sources/WmapParser/DataStructures/Dependency.swift
new file mode 100644
index 0000000..5f0089c
--- /dev/null
+++ b/Sources/WmapParser/DataStructures/Dependency.swift
@@ -0,0 +1,8 @@
+extension WmapParser {
+/// A dependency between two components.
+public struct Dependency: Sendable, Equatable {
+ public let fromComponent: String
+ public let toComponent: String
+ public let isDirected: Bool
+}
+}
diff --git a/Sources/WmapParser/DataStructures/Evolution.swift b/Sources/WmapParser/DataStructures/Evolution.swift
new file mode 100644
index 0000000..07fbf2a
--- /dev/null
+++ b/Sources/WmapParser/DataStructures/Evolution.swift
@@ -0,0 +1,7 @@
+extension WmapParser {
+/// Evolution associated with a component.
+public struct Evolution: Sendable, Equatable {
+ public let component: String
+ public let value: Double
+}
+}
diff --git a/Sources/WmapParser/DataStructures/Group.swift b/Sources/WmapParser/DataStructures/Group.swift
new file mode 100644
index 0000000..5dabc11
--- /dev/null
+++ b/Sources/WmapParser/DataStructures/Group.swift
@@ -0,0 +1,6 @@
+extension WmapParser {
+ /// A group of components.
+ public struct Group: Sendable, Equatable {
+ public let components: [String]
+ }
+}
diff --git a/Sources/WmapParser/DataStructures/Inertia.swift b/Sources/WmapParser/DataStructures/Inertia.swift
new file mode 100644
index 0000000..146ad70
--- /dev/null
+++ b/Sources/WmapParser/DataStructures/Inertia.swift
@@ -0,0 +1,6 @@
+extension WmapParser {
+ /// Inertia associated with a component.
+ public struct Inertia: Sendable, Equatable {
+ public let component: String
+ }
+}
diff --git a/Sources/WmapParser/DataStructures/Map.swift b/Sources/WmapParser/DataStructures/Map.swift
new file mode 100644
index 0000000..dbb3c7d
--- /dev/null
+++ b/Sources/WmapParser/DataStructures/Map.swift
@@ -0,0 +1,12 @@
+extension WmapParser {
+/// A parsed wardley map.
+public struct Map: Sendable {
+ public let components: [Component]
+ public let dependencies: [Dependency]
+ public let notes: [Note]
+ public let stages: [Stage]
+ public let groups: [Group]
+ public let inertias: [Inertia]
+ public let evolutions: [Evolution]
+}
+}
diff --git a/Sources/WmapParser/DataStructures/MapPoint.swift b/Sources/WmapParser/DataStructures/MapPoint.swift
new file mode 100644
index 0000000..c0eb971
--- /dev/null
+++ b/Sources/WmapParser/DataStructures/MapPoint.swift
@@ -0,0 +1,7 @@
+extension WmapParser {
+ /// A point in the map
+ public struct MapPoint: Sendable, Equatable {
+ let xCoordinate: Double
+ let yCoordinate: Double
+ }
+}
diff --git a/Sources/WmapParser/DataStructures/Note.swift b/Sources/WmapParser/DataStructures/Note.swift
new file mode 100644
index 0000000..de87979
--- /dev/null
+++ b/Sources/WmapParser/DataStructures/Note.swift
@@ -0,0 +1,7 @@
+extension WmapParser {
+/// A note.
+public struct Note: Sendable, Equatable {
+ public let text: String
+ public let coordinates: MapPoint
+}
+}
diff --git a/Sources/WmapParser/DataStructures/Shape.swift b/Sources/WmapParser/DataStructures/Shape.swift
new file mode 100644
index 0000000..146b0e6
--- /dev/null
+++ b/Sources/WmapParser/DataStructures/Shape.swift
@@ -0,0 +1,10 @@
+extension WmapParser {
+/// Any of the potential shapes in a component.
+@frozen
+public enum Shape: Sendable, Equatable {
+ case circle
+ case xMark
+ case square
+ case triangle
+}
+}
diff --git a/Sources/WmapParser/DataStructures/Stage.swift b/Sources/WmapParser/DataStructures/Stage.swift
new file mode 100644
index 0000000..e0a99f1
--- /dev/null
+++ b/Sources/WmapParser/DataStructures/Stage.swift
@@ -0,0 +1,7 @@
+extension WmapParser {
+/// An override for the width of an evolution stage.
+public struct Stage: Sendable, Equatable {
+ public let stage: StageNumber
+ public let value: Double
+}
+}
diff --git a/Sources/WmapParser/DataStructures/StageNumber.swift b/Sources/WmapParser/DataStructures/StageNumber.swift
new file mode 100644
index 0000000..603e06b
--- /dev/null
+++ b/Sources/WmapParser/DataStructures/StageNumber.swift
@@ -0,0 +1,10 @@
+extension WmapParser {
+/// The potential stages of evolution.
+@frozen
+public enum StageNumber: Sendable, Equatable {
+ case stageI
+ case stageII
+ case stageIII
+ case stageIV
+}
+}