Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions .github/workflows/dotnet.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
48 changes: 35 additions & 13 deletions NosCore.PathFinder.sln
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 2 additions & 1 deletion NosCore.PathFinder.sln.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@
-----------------------------------</s:String>
<s:Boolean x:Key="/Default/CodeStyle/Generate/=Implementations/@KeyIndexDefined">True</s:Boolean>
<s:String x:Key="/Default/CodeStyle/Generate/=Implementations/Options/=Async/@EntryIndexedValue">False</s:String>
<s:Boolean x:Key="/Default/CodeStyle/Naming/CSharpAutoNaming/IsNotificationDisabled/@EntryValue">True</s:Boolean></wpf:ResourceDictionary>
<s:Boolean x:Key="/Default/CodeStyle/Naming/CSharpAutoNaming/IsNotificationDisabled/@EntryValue">True</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EFeature_002EServices_002ECodeCleanup_002EFileHeader_002EFileHeaderSettingsMigrate/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
2 changes: 1 addition & 1 deletion configuration/pathfinder.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ Language: en
Database:
Host: localhost
Port: 5432
Database: postgres
Database: noscore
Username: postgres
Password: password
4 changes: 2 additions & 2 deletions documentation/BrushFireTests.Test_BrushFire.approved.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# NosCore.Pathfinder's Documentation
# NosCore.Pathfinder's Documentation
## Brushfire
- Filename: brushfire.png
- Checksum: 7dcc6fcc2533ffe40798dcd1771c3c1d28d10fdf10bed8a4b2cad8ef8bc4009b
- Checksum: 29051db500b2fac5499053f08f66418ad3d6d43efb4af774d07e5ef6e0c9abaf
![brushfire](./brushfire.png)
5 changes: 5 additions & 0 deletions documentation/FlowFieldTests.Test_FlowField.approved.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# NosCore.Pathfinder's Documentation
## Flow Field (Vector Field Pathfinding)
- Filename: flow-field.png
- Checksum: 29051db500b2fac5499053f08f66418ad3d6d43efb4af774d07e5ef6e0c9abaf
![brushfire](./flow-field.png)
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# NosCore.Pathfinder's Documentation
## Flow Field Path (Monster following vectors to Player)
- Filename: flow-field-path.png
- Checksum: c7697a4c6a7405866a41bab1bc4cb58ad5fa501be81ab3ecf80e72d4d78788ff
![brushfire](./flow-field-path.png)
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# NosCore.Pathfinder's Documentation
## Goal Based Pathfinder
- Filename: goal-based-pathfinder.png
- Checksum: 508c4ed1101bab0cc5f36e6e785a69b6e7892a9a511ebe23b338e4edf1cebc6a
- Checksum: c7697a4c6a7405866a41bab1bc4cb58ad5fa501be81ab3ecf80e72d4d78788ff
![brushfire](./goal-based-pathfinder.png)
Original file line number Diff line number Diff line change
@@ -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
![brushfire](./jump-point-search-pathfinder.png)
Binary file modified documentation/brushfire.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added documentation/flow-field-path.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added documentation/flow-field.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified documentation/goal-based-pathfinder.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified documentation/jump-point-search-pathfinder.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions src/NosCore.PathFinder.Api/Database/Map.cs
Original file line number Diff line number Diff line change
@@ -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> MapMonster { get; set; } = new HashSet<MapMonster>();

public virtual ICollection<MapNpc> MapNpc { get; set; } = new HashSet<MapNpc>();
}
27 changes: 27 additions & 0 deletions src/NosCore.PathFinder.Api/Database/MapMonster.cs
Original file line number Diff line number Diff line change
@@ -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!;
}
27 changes: 27 additions & 0 deletions src/NosCore.PathFinder.Api/Database/MapNpc.cs
Original file line number Diff line number Diff line change
@@ -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!;
}
39 changes: 39 additions & 0 deletions src/NosCore.PathFinder.Api/Database/PathFinderContext.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// __ _ __ __ ___ __ ___ ___
// | \| |/__\ /' _/ / _//__\| _ \ __|
// | | ' | \/ |`._`.| \_| \/ | v / _|
// |_|\__|\__/ |___/ \__/\__/|_|_\___|
// -----------------------------------

using Microsoft.EntityFrameworkCore;

namespace NosCore.PathFinder.Api.Database;

public class PathFinderContext : DbContext
{
public PathFinderContext(DbContextOptions<PathFinderContext> options) : base(options)
{
}

public virtual DbSet<Map> Map { get; set; } = null!;
public virtual DbSet<MapMonster> MapMonster { get; set; } = null!;
public virtual DbSet<MapNpc> MapNpc { get; set; } = null!;

protected override void OnModelCreating(ModelBuilder modelBuilder)
{
modelBuilder.Entity<Map>().ToTable("Map");
modelBuilder.Entity<MapMonster>().ToTable("MapMonster");
modelBuilder.Entity<MapNpc>().ToTable("MapNpc");

modelBuilder.Entity<Map>()
.HasMany(e => e.MapMonster)
.WithOne(e => e.Map)
.HasForeignKey(e => e.MapId)
.OnDelete(DeleteBehavior.Restrict);

modelBuilder.Entity<Map>()
.HasMany(e => e.MapNpc)
.WithOne(e => e.Map)
.HasForeignKey(e => e.MapId)
.OnDelete(DeleteBehavior.Restrict);
}
}
29 changes: 29 additions & 0 deletions src/NosCore.PathFinder.Api/LogLanguageKey.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
// __ _ __ __ ___ __ ___ ___
// | \| |/__\ /' _/ / _//__\| _ \ __|
// | | ' | \/ |`._`.| \_| \/ | v / _|
// |_|\__|\__/ |___/ \__/\__/|_|_\___|
// -----------------------------------

using System.Diagnostics.CodeAnalysis;

namespace NosCore.PathFinder.Api;

[SuppressMessage("ReSharper", "InconsistentNaming")]
public enum LogLanguageKey
{
DATABASE_CONFIGURED,
NO_DATABASE_CONFIGURED,
BASE_DIRECTORY,
CURRENT_DIRECTORY,
SEARCHING_FOR_CONFIG,
CHECKING_PATH,
LOADED_DATABASE_CONFIG,
FAILED_TO_PARSE_CONFIG,
USING_CONNECTION_STRING_FROM_APPSETTINGS,
NO_DATABASE_CONFIGURATION_FOUND,
LOADED_MAPS_FROM_DATABASE,
FAILED_TO_LOAD_MAP,
FAILED_TO_CONNECT_TO_DATABASE,
API_STARTED,
LANGUAGE_LOADED
}
Loading
Loading