diff --git a/.idea/.idea.NodeEditor/.idea/workspace.xml b/.idea/.idea.NodeEditor/.idea/workspace.xml
index 0866b46..a73630b 100644
--- a/.idea/.idea.NodeEditor/.idea/workspace.xml
+++ b/.idea/.idea.NodeEditor/.idea/workspace.xml
@@ -28,10 +28,9 @@
-
+
-
-
+
@@ -46,25 +45,10 @@
-
-
-
-
-
+
+
+
@@ -119,9 +103,7 @@
1608418540783
-
-
-
+
1608580007149
diff --git a/App.config b/App.config
deleted file mode 100644
index 56efbc7..0000000
--- a/App.config
+++ /dev/null
@@ -1,6 +0,0 @@
-
-
-
-
-
-
\ No newline at end of file
diff --git a/App.xaml b/App.xaml
index e08e285..a7bdccb 100644
--- a/App.xaml
+++ b/App.xaml
@@ -5,14 +5,7 @@
xmlns:local="clr-namespace:NodeEditor"
StartupUri="MainWindow.xaml">
-
-
-
-
-
-
-
-
+
diff --git a/Controls/EditorCanvas.xaml b/Controls/EditorCanvas.xaml
index 8e0da6a..caea01a 100644
--- a/Controls/EditorCanvas.xaml
+++ b/Controls/EditorCanvas.xaml
@@ -12,8 +12,7 @@
-
-
+
diff --git a/Controls/EditorCanvas.xaml.cs b/Controls/EditorCanvas.xaml.cs
index 4156416..b487e0b 100644
--- a/Controls/EditorCanvas.xaml.cs
+++ b/Controls/EditorCanvas.xaml.cs
@@ -1,7 +1,16 @@
-using System.Windows;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media;
+using System.Windows.Media.Imaging;
+using System.Windows.Navigation;
+using System.Windows.Shapes;
+using NodeEditor.Extensions;
namespace NodeEditor.Controls
{
diff --git a/NodeEditor.Core.csproj b/NodeEditor.Core.csproj
new file mode 100644
index 0000000..9e37a87
--- /dev/null
+++ b/NodeEditor.Core.csproj
@@ -0,0 +1,27 @@
+
+
+ WinExe
+ net5.0-windows10.0.19041.0
+ true
+ NodeEditor
+ NodeEditor
+ 8
+ false
+ 10.0
+ 10.0.19041.0
+
+
+
+ SettingsSingleFileGenerator
+ Settings.Designer.cs
+
+
+
+
+
+ 12.0.3
+
+
+
+
+
diff --git a/NodeEditor.Core.sln b/NodeEditor.Core.sln
new file mode 100644
index 0000000..a0f3939
--- /dev/null
+++ b/NodeEditor.Core.sln
@@ -0,0 +1,25 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 16
+VisualStudioVersion = 16.0.30717.126
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NodeEditor.Core", "NodeEditor.Core.csproj", "{7128BB4E-70F6-499C-B0A8-D6775CE49B98}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {7128BB4E-70F6-499C-B0A8-D6775CE49B98}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {7128BB4E-70F6-499C-B0A8-D6775CE49B98}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {7128BB4E-70F6-499C-B0A8-D6775CE49B98}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {7128BB4E-70F6-499C-B0A8-D6775CE49B98}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {E026FADA-21ED-4144-8336-A570FD7F4A2A}
+ EndGlobalSection
+EndGlobal
diff --git a/NodeEditor.csproj b/NodeEditor.csproj
deleted file mode 100644
index be91828..0000000
--- a/NodeEditor.csproj
+++ /dev/null
@@ -1,144 +0,0 @@
-
-
-
-
- Debug
- AnyCPU
- {789876C7-6864-435A-A06B-1B51FE952783}
- WinExe
- NodeEditor
- NodeEditor
- v4.7.2
- win
- 512
- {60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
- 4
- true
- true
-
-
-
-
- AnyCPU
- true
- full
- false
- bin\Debug\
- DEBUG;TRACE
- prompt
- 4
-
-
- AnyCPU
- pdbonly
- true
- bin\Release\
- TRACE
- prompt
- 4
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- 4.0
-
-
-
-
-
-
-
-
- MSBuild:Compile
- Designer
-
-
- EditorCanvas.xaml
-
-
- Node.xaml
-
-
- Path.xaml
-
-
-
-
-
-
-
- Designer
- MSBuild:Compile
-
-
- Designer
- MSBuild:Compile
-
-
-
- MSBuild:Compile
- Designer
-
-
- App.xaml
- Code
-
-
-
- MainWindow.xaml
- Code
-
-
-
-
- Code
-
-
- True
- True
- Resources.resx
-
-
- True
- Settings.settings
- True
-
-
- ResXFileCodeGenerator
- Resources.Designer.cs
-
-
- SettingsSingleFileGenerator
- Settings.Designer.cs
-
-
-
-
-
-
-
-
-
-
-
- 0.9.2
-
-
- 12.0.3
-
-
-
-
-
\ No newline at end of file
diff --git a/NodeEditor.sln b/NodeEditor.sln
deleted file mode 100644
index 7016dde..0000000
--- a/NodeEditor.sln
+++ /dev/null
@@ -1,30 +0,0 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Version 16
-VisualStudioVersion = 16.0.30717.126
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NodeEditor", "NodeEditor.csproj", "{789876C7-6864-435A-A06B-1B51FE952783}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{C46C4EE2-1291-47C9-BF82-29915DE75727}"
- ProjectSection(SolutionItems) = preProject
- .gitignore = .gitignore
- EndProjectSection
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {789876C7-6864-435A-A06B-1B51FE952783}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {789876C7-6864-435A-A06B-1B51FE952783}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {789876C7-6864-435A-A06B-1B51FE952783}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {789876C7-6864-435A-A06B-1B51FE952783}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
- GlobalSection(ExtensibilityGlobals) = postSolution
- SolutionGuid = {7946BFFB-A64F-4F59-8D29-20725D1A4D76}
- EndGlobalSection
-EndGlobal
diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs
deleted file mode 100644
index 3d9859e..0000000
--- a/Properties/AssemblyInfo.cs
+++ /dev/null
@@ -1,55 +0,0 @@
-using System.Reflection;
-using System.Resources;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-using System.Windows;
-
-// General Information about an assembly is controlled through the following
-// set of attributes. Change these attribute values to modify the information
-// associated with an assembly.
-[assembly: AssemblyTitle("NodeEditor")]
-[assembly: AssemblyDescription("")]
-[assembly: AssemblyConfiguration("")]
-[assembly: AssemblyCompany("")]
-[assembly: AssemblyProduct("NodeEditor")]
-[assembly: AssemblyCopyright("Copyright © 2020")]
-[assembly: AssemblyTrademark("")]
-[assembly: AssemblyCulture("")]
-
-// Setting ComVisible to false makes the types in this assembly not visible
-// to COM components. If you need to access a type in this assembly from
-// COM, set the ComVisible attribute to true on that type.
-[assembly: ComVisible(false)]
-
-//In order to begin building localizable applications, set
-//CultureYouAreCodingWith in your .csproj file
-//inside a . For example, if you are using US english
-//in your source files, set the to en-US. Then uncomment
-//the NeutralResourceLanguage attribute below. Update the "en-US" in
-//the line below to match the UICulture setting in the project file.
-
-//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
-
-
-[assembly: ThemeInfo(
- ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
- //(used if a resource is not found in the page,
- // or application resource dictionaries)
- ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
- //(used if a resource is not found in the page,
- // app, or any theme specific resource dictionaries)
-)]
-
-
-// Version information for an assembly consists of the following four values:
-//
-// Major Version
-// Minor Version
-// Build Number
-// Revision
-//
-// You can specify all the values or you can default the Build and Revision Numbers
-// by using the '*' as shown below:
-// [assembly: AssemblyVersion("1.0.*")]
-[assembly: AssemblyVersion("1.0.0.0")]
-[assembly: AssemblyFileVersion("1.0.0.0")]
diff --git a/main-map.png b/assets/main-map_yellow.png
similarity index 100%
rename from main-map.png
rename to assets/main-map_yellow.png
diff --git a/schema/data.json b/schema/data.json
new file mode 100644
index 0000000..9bdccbd
--- /dev/null
+++ b/schema/data.json
@@ -0,0 +1,35 @@
+{
+ "$schema": "./data.schema.json",
+ "A": {
+ "name": "Nemract",
+ "walk_connections": {
+ "B": {
+ "distance": 100,
+ "terrain_level": 10,
+ "weight": 1
+ }
+ },
+ "x": 100,
+ "y": 100,
+ "qt_connections": {
+ "C": {
+ "cost": 100,
+ "mode": "seaskipper",
+ "unlock_lvl": 10
+ }
+ }
+ },
+ "B":{
+ "name": "Llevagar",
+ "description": "Description",
+ "x": 10,
+ "y": 111,
+ "walk_connections": {
+ "A": {
+ "distance": 111,
+ "terrain_level": 11,
+ "weight": 1
+ }
+ }
+ }
+}
diff --git a/schema/data.schema.json b/schema/data.schema.json
new file mode 100644
index 0000000..c47f6c8
--- /dev/null
+++ b/schema/data.schema.json
@@ -0,0 +1,99 @@
+{
+ "$schema": "http://json-schema.org/draft-07/schema",
+
+ "additionalProperties": {
+ "$ref": "#/definitions/map_node"
+ },
+ "propertyNames": {
+ "$ref": "#/definitions/node_name_regex"
+ },
+
+ "definitions": {
+ "node_name_regex": {
+ "type": "string",
+ "pattern": "[\\w]+"
+ },
+ "map_node": {
+ "properties": {
+ "x": {
+ "description": "The x coordinate.",
+ "type": "integer"
+ },
+ "y": {
+ "description": "The y coordinate.",
+ "type": "integer"
+ },
+ "name": {
+ "description": "Human-readable name.",
+ "type": "string"
+ },
+ "description": {
+ "description": "Description of node, if needed.",
+ "type": "string"
+ },
+ "qt_connections": {
+ "description": "List of connected nodes",
+ "additionalProperties": { "$ref": "#/definitions/qt_connection" },
+ "propertyNames": {
+ "$ref": "#/definitions/node_name_regex"
+ }
+ },
+ "walk_connections": {
+ "description": "List of connected nodes",
+ "additionalProperties": { "$ref": "#/definitions/walk_connection" },
+ "propertyNames": {
+ "$ref": "#/definitions/node_name_regex"
+ }
+ }
+ },
+ "required": ["x", "y", "name", "walk_connections"],
+ "additionalItems": false
+ },
+ "qt_connection": {
+ "$comment": "A quick-travel conenction between nodes that should be evaluated first.",
+ "properties": {
+ "mode": {
+ "description": "The mode of the fast travel method.",
+ "enum": ["mageisland", "seaskipper", "tunnels", "skyship", "elevator"]
+ },
+ "cost": {
+ "description": "The cost in emeralds of this route",
+ "type": "integer",
+ "minimum": 0
+ },
+ "unlock_lvl": {
+ "description": "The level this fast travel is unlocked at",
+ "type": "integer",
+ "minimum": 0,
+ "maximum": 110
+ }
+ },
+ "required": ["mode", "cost", "unlock_lvl"],
+ "additionalItems": false
+ },
+ "walk_connection": {
+ "$comment": "A walking connection between two nodes",
+ "properties": {
+ "distance": {
+ "description": "The better disnance between two nodes, not necisarily as the crow flies. Should be used in the a* calc for distance back.",
+ "type": "integer",
+ "minimum": 0
+ },
+ "weight": {
+ "description": "Weight value used to modulate the distance based on passability",
+ "type": "number",
+ "minimum": 0,
+ "default": 1
+ },
+ "terrain_level": {
+ "description": "The highest level of the terain this connection passes through",
+ "type": "integer",
+ "minimum": 0,
+ "maximum": 110
+ }
+ },
+ "required": ["distance", "weight", "terrain_level"],
+ "additionalItems": false
+ }
+ }
+}