aboutsummaryrefslogtreecommitdiff
path: root/Map/Extensions
diff options
context:
space:
mode:
Diffstat (limited to 'Map/Extensions')
-rw-r--r--Map/Extensions/Date+format.swift17
-rw-r--r--Map/Extensions/Map+parse.swift28
-rw-r--r--Map/Extensions/NSImage+writePNG.swift25
3 files changed, 0 insertions, 70 deletions
diff --git a/Map/Extensions/Date+format.swift b/Map/Extensions/Date+format.swift
deleted file mode 100644
index d29ed0f..0000000
--- a/Map/Extensions/Date+format.swift
+++ /dev/null
@@ -1,17 +0,0 @@
-//
-// Date+format.swift
-// Map
-//
-// Created by Ruben Beltran del Rio on 2/1/21.
-//
-
-import Foundation
-
-extension Date {
- func format() -> String {
- let formatter = DateFormatter()
- formatter.dateStyle = .short
- formatter.timeStyle = .medium
- return formatter.string(from: self)
- }
-}
diff --git a/Map/Extensions/Map+parse.swift b/Map/Extensions/Map+parse.swift
deleted file mode 100644
index 904f492..0000000
--- a/Map/Extensions/Map+parse.swift
+++ /dev/null
@@ -1,28 +0,0 @@
-extension Map {
- static func parse(content: String) -> ParsedMap {
-
- let parsers = [
- AnyMapParserStrategy(VertexParserStrategy()),
- AnyMapParserStrategy(EdgeParserStrategy()),
- AnyMapParserStrategy(BlockerParserStrategy()),
- AnyMapParserStrategy(OpportunityParserStrategy()),
- AnyMapParserStrategy(StageParserStrategy()),
- ]
- let builder = MapBuilder()
-
- let lines = content.split(whereSeparator: \.isNewline)
-
- for (index, line) in lines.enumerated() {
- for parser in parsers {
- if parser.canHandle(line: String(line)) {
- let (type, object) = parser.handle(
- index: index, line: String(line), vertices: builder.vertices)
- builder.addObjectToMap(type: type, object: object)
- break
- }
- }
- }
-
- return builder.build()
- }
-}
diff --git a/Map/Extensions/NSImage+writePNG.swift b/Map/Extensions/NSImage+writePNG.swift
deleted file mode 100644
index c24c0cf..0000000
--- a/Map/Extensions/NSImage+writePNG.swift
+++ /dev/null
@@ -1,25 +0,0 @@
-import Cocoa
-
-extension NSImage {
- public func writePNG(toURL url: URL) {
-
- guard let data = tiffRepresentation,
- let rep = NSBitmapImageRep(data: data),
- let imgData = rep.representation(
- using: .png, properties: [.compressionFactor: NSNumber(floatLiteral: 1.0)])
- else {
-
- print(
- "\(self.self) Error Function '\(#function)' Line: \(#line) No tiff rep found for image writing to \(url)"
- )
- return
- }
-
- do {
- try imgData.write(to: url)
- } catch let error {
- print(
- "\(self.self) Error Function '\(#function)' Line: \(#line) \(error.localizedDescription)")
- }
- }
-}