Skip to content

Commit

Permalink
Merge pull request #17 from ampm/ampm/replace_GamePlayKit_with_aStar
Browse files Browse the repository at this point in the history
[Bug] replace GamePlayKit with aStar for path finding
  • Loading branch information
garvankeeley authored Jul 3, 2019
2 parents 02b6f0b + 617c392 commit 1d17845
Show file tree
Hide file tree
Showing 18 changed files with 433 additions and 131 deletions.
1 change: 1 addition & 0 deletions Cartfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github "Dev1an/A-Star" ~> 3.0.0-beta-1
1 change: 1 addition & 0 deletions Cartfile.resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github "Dev1an/A-Star" "3.0.0-beta-1"
2 changes: 1 addition & 1 deletion DemoApp/AppDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate, UISplitViewControllerDele
var window: UIWindow?


func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplicationLaunchOptionsKey: Any]?) -> Bool {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
// Override point for customization after application launch.
let splitViewController = window!.rootViewController as! UISplitViewController
let navigationController = splitViewController.viewControllers[splitViewController.viewControllers.count-1] as! UINavigationController
Expand Down
2 changes: 1 addition & 1 deletion DemoApp/MasterViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class MasterViewController: UITableViewController {
return true
}

override func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCellEditingStyle, forRowAt indexPath: IndexPath) {
override func tableView(_ tableView: UITableView, commit editingStyle: UITableViewCell.EditingStyle, forRowAt indexPath: IndexPath) {
if editingStyle == .delete {
objects.remove(at: indexPath.row)
tableView.deleteRows(at: [indexPath], with: .fade)
Expand Down
199 changes: 140 additions & 59 deletions MappaMundi.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>IDEDidComputeMac32BitWarning</key>
<true/>
</dict>
</plist>
91 changes: 91 additions & 0 deletions MappaMundi.xcodeproj/xcshareddata/xcschemes/DemoApp.xcscheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "39BAD55A1FE19B9D00524FB7"
BuildableName = "DemoApp.app"
BlueprintName = "DemoApp"
ReferencedContainer = "container:MappaMundi.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "39BAD55A1FE19B9D00524FB7"
BuildableName = "DemoApp.app"
BlueprintName = "DemoApp"
ReferencedContainer = "container:MappaMundi.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "39BAD55A1FE19B9D00524FB7"
BuildableName = "DemoApp.app"
BlueprintName = "DemoApp"
ReferencedContainer = "container:MappaMundi.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<BuildableProductRunnable
runnableDebuggingMode = "0">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "39BAD55A1FE19B9D00524FB7"
BuildableName = "DemoApp.app"
BlueprintName = "DemoApp"
ReferencedContainer = "container:MappaMundi.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
90 changes: 90 additions & 0 deletions MappaMundi.xcodeproj/xcshareddata/xcschemes/DemoUITests.xcscheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1020"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "NO"
buildForArchiving = "NO"
buildForAnalyzing = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "39BAD5701FE19B9E00524FB7"
BuildableName = "DemoUITests.xctest"
BlueprintName = "DemoUITests"
ReferencedContainer = "container:MappaMundi.xcodeproj">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "39BAD5701FE19B9E00524FB7"
BuildableName = "DemoUITests.xctest"
BlueprintName = "DemoUITests"
ReferencedContainer = "container:MappaMundi.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "39BAD5701FE19B9E00524FB7"
BuildableName = "DemoUITests.xctest"
BlueprintName = "DemoUITests"
ReferencedContainer = "container:MappaMundi.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "39BAD5701FE19B9E00524FB7"
BuildableName = "DemoUITests.xctest"
BlueprintName = "DemoUITests"
ReferencedContainer = "container:MappaMundi.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
26 changes: 13 additions & 13 deletions MappaMundi.xcodeproj/xcshareddata/xcschemes/MappaMundi.xcscheme
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "NO"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "39AB5FE31FE4595000008FB3"
BlueprintIdentifier = "1355A47922C8A25C00EB635F"
BuildableName = "MappaMundi.framework"
BlueprintName = "MappaMundi"
ReferencedContainer = "container:MappaMundi.xcodeproj">
Expand All @@ -29,15 +29,6 @@
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
</Testables>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "39AB5FE31FE4595000008FB3"
BuildableName = "MappaMundi.framework"
BlueprintName = "MappaMundi"
ReferencedContainer = "container:MappaMundi.xcodeproj">
</BuildableReference>
</MacroExpansion>
<AdditionalOptions>
</AdditionalOptions>
</TestAction>
Expand All @@ -54,7 +45,7 @@
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "39AB5FE31FE4595000008FB3"
BlueprintIdentifier = "1355A47922C8A25C00EB635F"
BuildableName = "MappaMundi.framework"
BlueprintName = "MappaMundi"
ReferencedContainer = "container:MappaMundi.xcodeproj">
Expand All @@ -64,11 +55,20 @@
</AdditionalOptions>
</LaunchAction>
<ProfileAction
buildConfiguration = "Debug"
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "1355A47922C8A25C00EB635F"
BuildableName = "MappaMundi.framework"
BlueprintName = "MappaMundi"
ReferencedContainer = "container:MappaMundi.xcodeproj">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
Expand Down
2 changes: 0 additions & 2 deletions MappaMundi/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,5 @@
<string>1.0</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSPrincipalClass</key>
<string></string>
</dict>
</plist>
2 changes: 1 addition & 1 deletion Sources/GraphRepresentation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public protocol GraphRepresentation {

public extension MMScreenGraph {
func stringRepresentation(_ renderer: GraphRepresentation = DotRepresentation()) -> String {
buildGkGraph()
buildGraph()
renderer.begin()
namedScenes.forEach { (name, node) in
if let node = node as? MMScreenStateNode {
Expand Down
5 changes: 2 additions & 3 deletions Sources/MMGraphNode.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */

import Foundation
import GameplayKit

public class MMGraphElement {
let name: String
Expand All @@ -23,14 +22,14 @@ public class MMGraphElement {
public class MMGraphNode<T: MMUserState>: MMGraphElement {
var nodeType: String { return "Node" }

let gkNode: GKGraphNode
let mmNode: MMNode

weak var map: MMScreenGraph<T>?

init(_ map: MMScreenGraph<T>, name: String, file: String, line: UInt) {
self.map = map

self.gkNode = GKGraphNode()
self.mmNode = MMNode(name: name)

super.init(name: name, file: file, line: line)
}
Expand Down
Loading

0 comments on commit 1d17845

Please sign in to comment.