diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml
index 890fe59..f619f3e 100644
--- a/.github/workflows/dotnet.yml
+++ b/.github/workflows/dotnet.yml
@@ -16,21 +16,21 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
- dotnet-version: 7.0.x
-
+ dotnet-version: 10.0.x
+
- name: Check Tag
id: check-tag
run: |
if [[ v${{ github.event.ref }} =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
- echo ::set-output name=match::true
+ echo "match=true" >> $GITHUB_OUTPUT
fi
-
+
- name: Run Unit Tests
run: |
dotnet restore
dotnet build
dotnet test test/NosCore.PathFinder.Tests -v m
-
+
- name: Build Artifact
if: steps.check-tag.outputs.match == 'true'
id: build_artifact
@@ -39,23 +39,23 @@ jobs:
dotnet build -c Release
dotnet pack -c Release -o /tmp/nupkgs -v m -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg
dotnet nuget push /tmp/nupkgs/NosCore.PathFinder.${{github.event.ref}}.nupkg -s https://api.nuget.org/v3/index.json -k ${{secrets.NUGET_API_KEY}}
- echo ::set-output name=ARTIFACT_PATH::/tmp/nupkgs/NosCore.PathFinder.${{github.event.ref}}.nupkg
- echo ::set-output name=ARTIFACT_NAME::NosCore.PathFinder.${{github.event.ref}}.nupkg
-
+ echo "ARTIFACT_PATH=/tmp/nupkgs/NosCore.PathFinder.${{github.event.ref}}.nupkg" >> $GITHUB_OUTPUT
+ echo "ARTIFACT_NAME=NosCore.PathFinder.${{github.event.ref}}.nupkg" >> $GITHUB_OUTPUT
+
- name: Gets Latest Release
if: steps.check-tag.outputs.match == 'true'
id: latest_release_info
uses: jossef/action-latest-release-info@v1.1.0
env:
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }}
-
+
- name: Upload Release Asset
if: steps.check-tag.outputs.match == 'true'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }}
with:
- upload_url: ${{ steps.latest_release_info.outputs.upload_url }}
+ upload_url: ${{ steps.latest_release_info.outputs.upload_url }}
asset_path: ${{ steps.build_artifact.outputs.ARTIFACT_PATH }}
asset_name: ${{ steps.build_artifact.outputs.ARTIFACT_NAME }}
asset_content_type: application/zip
diff --git a/NosCore.PathFinder.sln b/NosCore.PathFinder.sln
index e181676..51774cc 100644
--- a/NosCore.PathFinder.sln
+++ b/NosCore.PathFinder.sln
@@ -1,38 +1,60 @@
Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Version 16
-VisualStudioVersion = 16.0.28527.54
+# Visual Studio Version 18
+VisualStudioVersion = 18.2.11408.102 d18.0
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NosCore.PathFinder", "src\NosCore.PathFinder\NosCore.PathFinder.csproj", "{8DC7839A-EB02-4E71-95DC-2D2BD9651E19}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NosCore.PathFinder.Tests", "test\NosCore.PathFinder.Tests\NosCore.PathFinder.Tests.csproj", "{BEEC67B8-A63B-43DE-87A5-73341AEFD62F}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NosCore.PathFinder.Gui", "src\NosCore.PathFinder.Gui\NosCore.PathFinder.Gui.csproj", "{FA7E228B-399D-4E03-994C-3C3D057E134E}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NosCore.PathFinder.Benchmark", "test\NosCore.PathFinder.Benchmark\NosCore.PathFinder.Benchmark\NosCore.PathFinder.Benchmark.csproj", "{159A99CE-A97C-4215-8FA8-38BC7C8D382D}"
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NosCore.PathFinder.Api", "src\NosCore.PathFinder.Api\NosCore.PathFinder.Api.csproj", "{6642B6A1-6EBE-4E38-A812-435286A0E04E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
+ Debug|x64 = Debug|x64
+ Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
+ Release|x64 = Release|x64
+ Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{8DC7839A-EB02-4E71-95DC-2D2BD9651E19}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{8DC7839A-EB02-4E71-95DC-2D2BD9651E19}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {8DC7839A-EB02-4E71-95DC-2D2BD9651E19}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {8DC7839A-EB02-4E71-95DC-2D2BD9651E19}.Debug|x64.Build.0 = Debug|Any CPU
+ {8DC7839A-EB02-4E71-95DC-2D2BD9651E19}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {8DC7839A-EB02-4E71-95DC-2D2BD9651E19}.Debug|x86.Build.0 = Debug|Any CPU
{8DC7839A-EB02-4E71-95DC-2D2BD9651E19}.Release|Any CPU.ActiveCfg = Release|Any CPU
{8DC7839A-EB02-4E71-95DC-2D2BD9651E19}.Release|Any CPU.Build.0 = Release|Any CPU
+ {8DC7839A-EB02-4E71-95DC-2D2BD9651E19}.Release|x64.ActiveCfg = Release|Any CPU
+ {8DC7839A-EB02-4E71-95DC-2D2BD9651E19}.Release|x64.Build.0 = Release|Any CPU
+ {8DC7839A-EB02-4E71-95DC-2D2BD9651E19}.Release|x86.ActiveCfg = Release|Any CPU
+ {8DC7839A-EB02-4E71-95DC-2D2BD9651E19}.Release|x86.Build.0 = Release|Any CPU
{BEEC67B8-A63B-43DE-87A5-73341AEFD62F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BEEC67B8-A63B-43DE-87A5-73341AEFD62F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {BEEC67B8-A63B-43DE-87A5-73341AEFD62F}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {BEEC67B8-A63B-43DE-87A5-73341AEFD62F}.Debug|x64.Build.0 = Debug|Any CPU
+ {BEEC67B8-A63B-43DE-87A5-73341AEFD62F}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {BEEC67B8-A63B-43DE-87A5-73341AEFD62F}.Debug|x86.Build.0 = Debug|Any CPU
{BEEC67B8-A63B-43DE-87A5-73341AEFD62F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BEEC67B8-A63B-43DE-87A5-73341AEFD62F}.Release|Any CPU.Build.0 = Release|Any CPU
- {FA7E228B-399D-4E03-994C-3C3D057E134E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {FA7E228B-399D-4E03-994C-3C3D057E134E}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {FA7E228B-399D-4E03-994C-3C3D057E134E}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {FA7E228B-399D-4E03-994C-3C3D057E134E}.Release|Any CPU.Build.0 = Release|Any CPU
- {159A99CE-A97C-4215-8FA8-38BC7C8D382D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {159A99CE-A97C-4215-8FA8-38BC7C8D382D}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {159A99CE-A97C-4215-8FA8-38BC7C8D382D}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {159A99CE-A97C-4215-8FA8-38BC7C8D382D}.Release|Any CPU.Build.0 = Release|Any CPU
+ {BEEC67B8-A63B-43DE-87A5-73341AEFD62F}.Release|x64.ActiveCfg = Release|Any CPU
+ {BEEC67B8-A63B-43DE-87A5-73341AEFD62F}.Release|x64.Build.0 = Release|Any CPU
+ {BEEC67B8-A63B-43DE-87A5-73341AEFD62F}.Release|x86.ActiveCfg = Release|Any CPU
+ {BEEC67B8-A63B-43DE-87A5-73341AEFD62F}.Release|x86.Build.0 = Release|Any CPU
+ {6642B6A1-6EBE-4E38-A812-435286A0E04E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {6642B6A1-6EBE-4E38-A812-435286A0E04E}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {6642B6A1-6EBE-4E38-A812-435286A0E04E}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {6642B6A1-6EBE-4E38-A812-435286A0E04E}.Debug|x64.Build.0 = Debug|Any CPU
+ {6642B6A1-6EBE-4E38-A812-435286A0E04E}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {6642B6A1-6EBE-4E38-A812-435286A0E04E}.Debug|x86.Build.0 = Debug|Any CPU
+ {6642B6A1-6EBE-4E38-A812-435286A0E04E}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {6642B6A1-6EBE-4E38-A812-435286A0E04E}.Release|Any CPU.Build.0 = Release|Any CPU
+ {6642B6A1-6EBE-4E38-A812-435286A0E04E}.Release|x64.ActiveCfg = Release|Any CPU
+ {6642B6A1-6EBE-4E38-A812-435286A0E04E}.Release|x64.Build.0 = Release|Any CPU
+ {6642B6A1-6EBE-4E38-A812-435286A0E04E}.Release|x86.ActiveCfg = Release|Any CPU
+ {6642B6A1-6EBE-4E38-A812-435286A0E04E}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
diff --git a/NosCore.PathFinder.sln.DotSettings b/NosCore.PathFinder.sln.DotSettings
index 53bb462..6e70b1b 100644
--- a/NosCore.PathFinder.sln.DotSettings
+++ b/NosCore.PathFinder.sln.DotSettings
@@ -8,4 +8,5 @@
-----------------------------------
True
False
- True
\ No newline at end of file
+ True
+ True
\ No newline at end of file
diff --git a/configuration/pathfinder.yml b/configuration/pathfinder.yml
index f6e8edb..47e592e 100644
--- a/configuration/pathfinder.yml
+++ b/configuration/pathfinder.yml
@@ -2,6 +2,6 @@ Language: en
Database:
Host: localhost
Port: 5432
- Database: postgres
+ Database: noscore
Username: postgres
Password: password
diff --git a/documentation/BrushFireTests.Test_BrushFire.approved.md b/documentation/BrushFireTests.Test_BrushFire.approved.md
index 9d0b862..8e12a52 100644
--- a/documentation/BrushFireTests.Test_BrushFire.approved.md
+++ b/documentation/BrushFireTests.Test_BrushFire.approved.md
@@ -1,5 +1,5 @@
-# NosCore.Pathfinder's Documentation
+# NosCore.Pathfinder's Documentation
## Brushfire
- Filename: brushfire.png
-- Checksum: 7dcc6fcc2533ffe40798dcd1771c3c1d28d10fdf10bed8a4b2cad8ef8bc4009b
+- Checksum: 29051db500b2fac5499053f08f66418ad3d6d43efb4af774d07e5ef6e0c9abaf

diff --git a/documentation/FlowFieldTests.Test_FlowField.approved.md b/documentation/FlowFieldTests.Test_FlowField.approved.md
new file mode 100644
index 0000000..308b784
--- /dev/null
+++ b/documentation/FlowFieldTests.Test_FlowField.approved.md
@@ -0,0 +1,5 @@
+# NosCore.Pathfinder's Documentation
+## Flow Field (Vector Field Pathfinding)
+- Filename: flow-field.png
+- Checksum: 29051db500b2fac5499053f08f66418ad3d6d43efb4af774d07e5ef6e0c9abaf
+
diff --git a/documentation/FlowFieldTests.Test_FlowField_MonsterPath.approved.md b/documentation/FlowFieldTests.Test_FlowField_MonsterPath.approved.md
new file mode 100644
index 0000000..c3a7144
--- /dev/null
+++ b/documentation/FlowFieldTests.Test_FlowField_MonsterPath.approved.md
@@ -0,0 +1,5 @@
+# NosCore.Pathfinder's Documentation
+## Flow Field Path (Monster following vectors to Player)
+- Filename: flow-field-path.png
+- Checksum: c7697a4c6a7405866a41bab1bc4cb58ad5fa501be81ab3ecf80e72d4d78788ff
+
diff --git a/documentation/GoalBasedPathfinderTests.Test_GoalBasedPathfinder.approved.md b/documentation/GoalBasedPathfinderTests.Test_GoalBasedPathfinder.approved.md
index 6288f47..c689cf6 100644
--- a/documentation/GoalBasedPathfinderTests.Test_GoalBasedPathfinder.approved.md
+++ b/documentation/GoalBasedPathfinderTests.Test_GoalBasedPathfinder.approved.md
@@ -1,5 +1,5 @@
# NosCore.Pathfinder's Documentation
## Goal Based Pathfinder
- Filename: goal-based-pathfinder.png
-- Checksum: 508c4ed1101bab0cc5f36e6e785a69b6e7892a9a511ebe23b338e4edf1cebc6a
+- Checksum: c7697a4c6a7405866a41bab1bc4cb58ad5fa501be81ab3ecf80e72d4d78788ff

diff --git a/documentation/JumpPointSearchPathfinderTests.Test_JumpPointSearchPathfinder.approved.md b/documentation/JumpPointSearchPathfinderTests.Test_JumpPointSearchPathfinder.approved.md
index d48274c..a5a9f1c 100644
--- a/documentation/JumpPointSearchPathfinderTests.Test_JumpPointSearchPathfinder.approved.md
+++ b/documentation/JumpPointSearchPathfinderTests.Test_JumpPointSearchPathfinder.approved.md
@@ -1,5 +1,5 @@
# NosCore.Pathfinder's Documentation
## Jump Point Search Pathfinder (break at walls)
- Filename: jump-point-search-pathfinder.png
-- Checksum: 0944988268fb7f1f6601bf1516aaccaca25a43bb583c5a92b1da3d6cd4f8ccc7
+- Checksum: c255a02a91718ee50823cc1f4070d782e7a06f9e79cabcd1aaad780882b4c165

diff --git a/documentation/brushfire.png b/documentation/brushfire.png
index 5eabab5..540b68d 100644
Binary files a/documentation/brushfire.png and b/documentation/brushfire.png differ
diff --git a/documentation/flow-field-path.png b/documentation/flow-field-path.png
new file mode 100644
index 0000000..2b74368
Binary files /dev/null and b/documentation/flow-field-path.png differ
diff --git a/documentation/flow-field.png b/documentation/flow-field.png
new file mode 100644
index 0000000..38840d3
Binary files /dev/null and b/documentation/flow-field.png differ
diff --git a/documentation/goal-based-pathfinder.png b/documentation/goal-based-pathfinder.png
index 9a93149..c636a01 100644
Binary files a/documentation/goal-based-pathfinder.png and b/documentation/goal-based-pathfinder.png differ
diff --git a/documentation/jump-point-search-pathfinder.png b/documentation/jump-point-search-pathfinder.png
index 1474272..5b5be09 100644
Binary files a/documentation/jump-point-search-pathfinder.png and b/documentation/jump-point-search-pathfinder.png differ
diff --git a/src/NosCore.PathFinder.Api/Database/Map.cs b/src/NosCore.PathFinder.Api/Database/Map.cs
new file mode 100644
index 0000000..4ac8cc1
--- /dev/null
+++ b/src/NosCore.PathFinder.Api/Database/Map.cs
@@ -0,0 +1,23 @@
+// __ _ __ __ ___ __ ___ ___
+// | \| |/__\ /' _/ / _//__\| _ \ __|
+// | | ' | \/ |`._`.| \_| \/ | v / _|
+// |_|\__|\__/ |___/ \__/\__/|_|_\___|
+// -----------------------------------
+
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+
+namespace NosCore.PathFinder.Api.Database;
+
+public class Map
+{
+ [Key]
+ [DatabaseGenerated(DatabaseGeneratedOption.None)]
+ public short MapId { get; set; }
+
+ public byte[] Data { get; set; } = null!;
+
+ public virtual ICollection MapMonster { get; set; } = new HashSet();
+
+ public virtual ICollection MapNpc { get; set; } = new HashSet();
+}
diff --git a/src/NosCore.PathFinder.Api/Database/MapMonster.cs b/src/NosCore.PathFinder.Api/Database/MapMonster.cs
new file mode 100644
index 0000000..796ea70
--- /dev/null
+++ b/src/NosCore.PathFinder.Api/Database/MapMonster.cs
@@ -0,0 +1,27 @@
+// __ _ __ __ ___ __ ___ ___
+// | \| |/__\ /' _/ / _//__\| _ \ __|
+// | | ' | \/ |`._`.| \_| \/ | v / _|
+// |_|\__|\__/ |___/ \__/\__/|_|_\___|
+// -----------------------------------
+
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+
+namespace NosCore.PathFinder.Api.Database;
+
+public class MapMonster
+{
+ [Key]
+ [DatabaseGenerated(DatabaseGeneratedOption.None)]
+ public int MapMonsterId { get; set; }
+
+ public short MapId { get; set; }
+
+ public short MapX { get; set; }
+
+ public short MapY { get; set; }
+
+ public short VNum { get; set; }
+
+ public virtual Map Map { get; set; } = null!;
+}
diff --git a/src/NosCore.PathFinder.Api/Database/MapNpc.cs b/src/NosCore.PathFinder.Api/Database/MapNpc.cs
new file mode 100644
index 0000000..6598de7
--- /dev/null
+++ b/src/NosCore.PathFinder.Api/Database/MapNpc.cs
@@ -0,0 +1,27 @@
+// __ _ __ __ ___ __ ___ ___
+// | \| |/__\ /' _/ / _//__\| _ \ __|
+// | | ' | \/ |`._`.| \_| \/ | v / _|
+// |_|\__|\__/ |___/ \__/\__/|_|_\___|
+// -----------------------------------
+
+using System.ComponentModel.DataAnnotations;
+using System.ComponentModel.DataAnnotations.Schema;
+
+namespace NosCore.PathFinder.Api.Database;
+
+public class MapNpc
+{
+ [Key]
+ [DatabaseGenerated(DatabaseGeneratedOption.None)]
+ public int MapNpcId { get; set; }
+
+ public short MapId { get; set; }
+
+ public short MapX { get; set; }
+
+ public short MapY { get; set; }
+
+ public short VNum { get; set; }
+
+ public virtual Map Map { get; set; } = null!;
+}
diff --git a/src/NosCore.PathFinder.Api/Database/PathFinderContext.cs b/src/NosCore.PathFinder.Api/Database/PathFinderContext.cs
new file mode 100644
index 0000000..307d065
--- /dev/null
+++ b/src/NosCore.PathFinder.Api/Database/PathFinderContext.cs
@@ -0,0 +1,39 @@
+// __ _ __ __ ___ __ ___ ___
+// | \| |/__\ /' _/ / _//__\| _ \ __|
+// | | ' | \/ |`._`.| \_| \/ | v / _|
+// |_|\__|\__/ |___/ \__/\__/|_|_\___|
+// -----------------------------------
+
+using Microsoft.EntityFrameworkCore;
+
+namespace NosCore.PathFinder.Api.Database;
+
+public class PathFinderContext : DbContext
+{
+ public PathFinderContext(DbContextOptions options) : base(options)
+ {
+ }
+
+ public virtual DbSet