From b1e0ccf233d0826c0068d7477480381979e14365 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 15 Nov 2025 00:35:31 +0000 Subject: [PATCH 01/21] Upgrade project to .NET 10 - Updated all .csproj files to target net10.0 - Updated NuGet packages to version 10.0.0: - Microsoft.Bcl.AsyncInterfaces - Microsoft.Extensions.Configuration.Binder - Microsoft.EntityFrameworkCore - Microsoft.Extensions.DependencyModel - Npgsql.EntityFrameworkCore.PostgreSQL - Microsoft.EntityFrameworkCore.Sqlite - Updated GitHub Actions workflow to use .NET 10.0.x --- .github/workflows/dotnet.yml | 2 +- src/NosCore.PathFinder.Gui/NosCore.PathFinder.Gui.csproj | 8 ++++---- src/NosCore.PathFinder/NosCore.PathFinder.csproj | 6 +++--- .../NosCore.PathFinder.Benchmark.csproj | 2 +- .../NosCore.PathFinder.Tests.csproj | 4 ++-- 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 890fe59..4066813 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -16,7 +16,7 @@ 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 diff --git a/src/NosCore.PathFinder.Gui/NosCore.PathFinder.Gui.csproj b/src/NosCore.PathFinder.Gui/NosCore.PathFinder.Gui.csproj index ca74c23..b0629ee 100644 --- a/src/NosCore.PathFinder.Gui/NosCore.PathFinder.Gui.csproj +++ b/src/NosCore.PathFinder.Gui/NosCore.PathFinder.Gui.csproj @@ -2,7 +2,7 @@ Exe - net7.0 + net10.0 true latest enable @@ -14,12 +14,12 @@ - - + + - + diff --git a/src/NosCore.PathFinder/NosCore.PathFinder.csproj b/src/NosCore.PathFinder/NosCore.PathFinder.csproj index 1ae42b2..b42dc44 100644 --- a/src/NosCore.PathFinder/NosCore.PathFinder.csproj +++ b/src/NosCore.PathFinder/NosCore.PathFinder.csproj @@ -1,7 +1,7 @@  - net7.0 + net10.0 latest favicon.ico true @@ -30,8 +30,8 @@ - - + + diff --git a/test/NosCore.PathFinder.Benchmark/NosCore.PathFinder.Benchmark/NosCore.PathFinder.Benchmark.csproj b/test/NosCore.PathFinder.Benchmark/NosCore.PathFinder.Benchmark/NosCore.PathFinder.Benchmark.csproj index 5d489e5..a496211 100644 --- a/test/NosCore.PathFinder.Benchmark/NosCore.PathFinder.Benchmark/NosCore.PathFinder.Benchmark.csproj +++ b/test/NosCore.PathFinder.Benchmark/NosCore.PathFinder.Benchmark/NosCore.PathFinder.Benchmark.csproj @@ -1,7 +1,7 @@ Exe - net7.0 + net10.0 enable diff --git a/test/NosCore.PathFinder.Tests/NosCore.PathFinder.Tests.csproj b/test/NosCore.PathFinder.Tests/NosCore.PathFinder.Tests.csproj index 066585c..cf96f30 100644 --- a/test/NosCore.PathFinder.Tests/NosCore.PathFinder.Tests.csproj +++ b/test/NosCore.PathFinder.Tests/NosCore.PathFinder.Tests.csproj @@ -1,14 +1,14 @@  - net7.0 + net10.0 enable false - + From 55d6a92a3fc7bd2b21aa87fd7ae57a974aa4e82a Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 15 Nov 2025 00:51:05 +0000 Subject: [PATCH 02/21] Fix package versions for .NET 10 compatibility - Updated Npgsql.EntityFrameworkCore.PostgreSQL to 10.0.0-rc.2 (latest version compatible with EF Core 10) - Removed Microsoft.Bcl.AsyncInterfaces package (built-in to .NET 10, no longer needed) All other packages are using stable 10.0.0 versions: - Microsoft.EntityFrameworkCore: 10.0.0 - Microsoft.Extensions.Configuration.Binder: 10.0.0 - Microsoft.Extensions.DependencyModel: 10.0.0 - Microsoft.EntityFrameworkCore.Sqlite: 10.0.0 --- src/NosCore.PathFinder.Gui/NosCore.PathFinder.Gui.csproj | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/NosCore.PathFinder.Gui/NosCore.PathFinder.Gui.csproj b/src/NosCore.PathFinder.Gui/NosCore.PathFinder.Gui.csproj index b0629ee..9c5ae83 100644 --- a/src/NosCore.PathFinder.Gui/NosCore.PathFinder.Gui.csproj +++ b/src/NosCore.PathFinder.Gui/NosCore.PathFinder.Gui.csproj @@ -14,12 +14,11 @@ - - + From 822e2a57e2387bb21fd03d1ff0ca6f3fe15dfe5f Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 15 Nov 2025 00:52:50 +0000 Subject: [PATCH 03/21] Fix GitHub Actions workflow for modern standards - Updated actions/checkout from v2 to v4 - Updated actions/setup-dotnet from v3 to v4 - Replaced deprecated ::set-output commands with $GITHUB_OUTPUT - Replaced deprecated actions/upload-release-asset@v1 with softprops/action-gh-release@v2 - Removed unnecessary jossef/action-latest-release-info action These changes ensure the workflow is compatible with current GitHub Actions standards and will work properly with .NET 10. --- .github/workflows/dotnet.yml | 29 +++++++++-------------------- 1 file changed, 9 insertions(+), 20 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 4066813..7bff4a8 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -12,17 +12,17 @@ jobs: build: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 - name: Setup .NET - uses: actions/setup-dotnet@v3 + uses: actions/setup-dotnet@v4 with: 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 @@ -39,23 +39,12 @@ 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 - - - 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 }} + 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: Upload Release Asset if: steps.check-tag.outputs.match == 'true' - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }} + uses: softprops/action-gh-release@v2 with: - 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 + files: ${{ steps.build_artifact.outputs.ARTIFACT_PATH }} + token: ${{ secrets.REPO_TOKEN }} From 4f6cf7b1abe4e9d2fa32e805581883764acb5309 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 15 Nov 2025 01:01:28 +0000 Subject: [PATCH 04/21] Fix MSTest analyzer warning MSTEST0037 - Replace Assert.IsTrue with Assert.AreEqual as recommended by MSTest analyzer - Changed from Assert.IsTrue(!...Any()) to Assert.AreEqual(0, ...Count()) - This provides clearer test failure messages and follows modern MSTest best practices --- test/NosCore.PathFinder.Tests/IPathfinderTest.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/NosCore.PathFinder.Tests/IPathfinderTest.cs b/test/NosCore.PathFinder.Tests/IPathfinderTest.cs index 5d73934..6748265 100644 --- a/test/NosCore.PathFinder.Tests/IPathfinderTest.cs +++ b/test/NosCore.PathFinder.Tests/IPathfinderTest.cs @@ -44,7 +44,7 @@ public void AllPathfinderShouldReturnEnd() .GetTypes() .Where(mytype => mytype.GetInterfaces().Contains(typeof(IPathfinder))).ToList(); - Assert.IsTrue(!pathfindersTypes.Except(pathfinders.Select(s => s.GetType())).Any()); + Assert.AreEqual(0, pathfindersTypes.Except(pathfinders.Select(s => s.GetType())).Count()); foreach (var pathfinder in pathfinders) { From d11211a88a5350dd4c66e6510f91dcea03791ef2 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 15 Nov 2025 01:04:51 +0000 Subject: [PATCH 05/21] Add XML documentation to all public APIs and remove NoWarn directive - Added comprehensive XML documentation comments to all public interfaces: - IPathfinder, IMapGrid, IHeuristic - Added XML documentation to all public classes: - JumpPointSearchPathfinder - GoalBasedPathfinder - OctileDistanceHeuristic - Documented all public constructors, properties, methods, and fields - Removed NoWarn CS1591 directive from project file This ensures proper API documentation is generated and enforces documentation requirements through TreatWarningsAsErrors. --- .../Heuristic/OctileDistanceHeuristic.cs | 8 +++++++ .../Interfaces/IHeuristic.cs | 9 +++++++ src/NosCore.PathFinder/Interfaces/IMapGrid.cs | 24 +++++++++++++++++++ .../Interfaces/IPathfinder.cs | 9 +++++++ .../NosCore.PathFinder.csproj | 1 - .../Pathfinder/GoalBasedPathfinder.cs | 20 ++++++++++++++++ .../Pathfinder/JumpPointSearchPathfinder.cs | 21 ++++++++++++++++ 7 files changed, 91 insertions(+), 1 deletion(-) diff --git a/src/NosCore.PathFinder/Heuristic/OctileDistanceHeuristic.cs b/src/NosCore.PathFinder/Heuristic/OctileDistanceHeuristic.cs index b52f47c..1504011 100644 --- a/src/NosCore.PathFinder/Heuristic/OctileDistanceHeuristic.cs +++ b/src/NosCore.PathFinder/Heuristic/OctileDistanceHeuristic.cs @@ -9,10 +9,18 @@ namespace NosCore.PathFinder.Heuristic { + /// + /// Heuristic that calculates octile distance (diagonal distance allowing 8-directional movement). + /// This heuristic is optimal for grids that allow diagonal movement at sqrt(2) cost. + /// public class OctileDistanceHeuristic : IHeuristic { + /// + /// The square root of 2, used as the cost multiplier for diagonal movement. + /// public readonly double Sqrt2 = Math.Sqrt(2); + /// public double GetDistance((short X, short Y) fromValuedCell, (short X, short Y) toValuedCell) { var iDx = Math.Abs(fromValuedCell.X - toValuedCell.X); diff --git a/src/NosCore.PathFinder/Interfaces/IHeuristic.cs b/src/NosCore.PathFinder/Interfaces/IHeuristic.cs index 90e6fcc..3af6dae 100644 --- a/src/NosCore.PathFinder/Interfaces/IHeuristic.cs +++ b/src/NosCore.PathFinder/Interfaces/IHeuristic.cs @@ -6,8 +6,17 @@ namespace NosCore.PathFinder.Interfaces { + /// + /// Interface for heuristic distance calculation used in pathfinding algorithms. + /// public interface IHeuristic { + /// + /// Calculates the estimated distance between two points. + /// + /// The starting point coordinates. + /// The ending point coordinates. + /// The estimated distance between the two points. public double GetDistance((short X, short Y) from, (short X, short Y) to); } } diff --git a/src/NosCore.PathFinder/Interfaces/IMapGrid.cs b/src/NosCore.PathFinder/Interfaces/IMapGrid.cs index d78c3a8..fa0820d 100644 --- a/src/NosCore.PathFinder/Interfaces/IMapGrid.cs +++ b/src/NosCore.PathFinder/Interfaces/IMapGrid.cs @@ -6,11 +6,35 @@ namespace NosCore.PathFinder.Interfaces { + /// + /// Interface representing a grid-based map for pathfinding. + /// public interface IMapGrid { + /// + /// Gets the width of the map grid. + /// public short Width { get; } + + /// + /// Gets the height of the map grid. + /// public short Height { get; } + + /// + /// Gets the cell value at the specified coordinates. + /// + /// The X coordinate. + /// The Y coordinate. + /// The byte value representing the cell at the given position. public byte this[short x, short y] { get; } + + /// + /// Determines whether the specified position is walkable. + /// + /// The X coordinate to check. + /// The Y coordinate to check. + /// True if the position is walkable; otherwise, false. bool IsWalkable(short currentX, short currentY); } } \ No newline at end of file diff --git a/src/NosCore.PathFinder/Interfaces/IPathfinder.cs b/src/NosCore.PathFinder/Interfaces/IPathfinder.cs index 98c1825..0e56196 100644 --- a/src/NosCore.PathFinder/Interfaces/IPathfinder.cs +++ b/src/NosCore.PathFinder/Interfaces/IPathfinder.cs @@ -8,8 +8,17 @@ namespace NosCore.PathFinder.Interfaces { + /// + /// Interface for pathfinding algorithms that find paths on a grid-based map. + /// public interface IPathfinder { + /// + /// Finds a path between two points on the map grid. + /// + /// The starting coordinates (X, Y). + /// The ending coordinates (X, Y). + /// An enumerable sequence of coordinates representing the path from start to end. IEnumerable<(short X, short Y)> FindPath((short X, short Y) start, (short X, short Y) end); } } \ No newline at end of file diff --git a/src/NosCore.PathFinder/NosCore.PathFinder.csproj b/src/NosCore.PathFinder/NosCore.PathFinder.csproj index b42dc44..a9bc8c9 100644 --- a/src/NosCore.PathFinder/NosCore.PathFinder.csproj +++ b/src/NosCore.PathFinder/NosCore.PathFinder.csproj @@ -21,7 +21,6 @@ icon.png true true - CS1591 diff --git a/src/NosCore.PathFinder/Pathfinder/GoalBasedPathfinder.cs b/src/NosCore.PathFinder/Pathfinder/GoalBasedPathfinder.cs index 5fc6e7b..84338f4 100644 --- a/src/NosCore.PathFinder/Pathfinder/GoalBasedPathfinder.cs +++ b/src/NosCore.PathFinder/Pathfinder/GoalBasedPathfinder.cs @@ -13,18 +13,37 @@ namespace NosCore.PathFinder.Pathfinder { + /// + /// Goal-based pathfinder implementation using brushfire algorithm with caching. + /// This pathfinder pre-computes paths from goals and caches them for performance. + /// public class GoalBasedPathfinder : IPathfinder { private readonly IMapGrid _mapGrid; + + /// + /// Static memory cache for storing pre-computed brushfire data. + /// public static readonly MemoryCache BrushFirecache = new MemoryCache(new MemoryCacheOptions()); private readonly IHeuristic _heuristic; + /// + /// Initializes a new instance of the class. + /// + /// The map grid to use for pathfinding. + /// The heuristic to use for distance calculations. public GoalBasedPathfinder(IMapGrid mapGrid, IHeuristic heuristic) { _mapGrid = mapGrid; _heuristic = heuristic; } + /// + /// Initializes a new instance of the class with a pre-computed brushfire. + /// + /// The map grid to use for pathfinding. + /// The heuristic to use for distance calculations. + /// Pre-computed brushfire data to cache. public GoalBasedPathfinder(IMapGrid mapGrid, IHeuristic heuristic, BrushFire brushfire) : this(mapGrid, heuristic) { CacheBrushFire(brushfire, brushfire.Origin); @@ -68,6 +87,7 @@ private BrushFire CacheBrushFire(BrushFire brushFire, (short X, short Y) start) return brushFire; } + /// public IEnumerable<(short X, short Y)> FindPath((short X, short Y) start, (short X, short Y) end) { List<(short X, short Y)> list = new(); diff --git a/src/NosCore.PathFinder/Pathfinder/JumpPointSearchPathfinder.cs b/src/NosCore.PathFinder/Pathfinder/JumpPointSearchPathfinder.cs index db7810a..e35898b 100644 --- a/src/NosCore.PathFinder/Pathfinder/JumpPointSearchPathfinder.cs +++ b/src/NosCore.PathFinder/Pathfinder/JumpPointSearchPathfinder.cs @@ -13,12 +13,25 @@ namespace NosCore.PathFinder.Pathfinder { + /// + /// Jump Point Search (JPS) pathfinder implementation with caching. + /// JPS is an optimization of A* that skips unnecessary nodes in uniform-cost grids. + /// public class JumpPointSearchPathfinder : IPathfinder { private readonly IMapGrid _mapGrid; + + /// + /// Static memory cache for storing computed paths. + /// public static readonly MemoryCache Cache = new MemoryCache(new MemoryCacheOptions()); private readonly IHeuristic _heuristic; + /// + /// Initializes a new instance of the class. + /// + /// The map grid to use for pathfinding. + /// The heuristic to use for distance calculations. public JumpPointSearchPathfinder(IMapGrid mapGrid, IHeuristic heuristic) { _mapGrid = mapGrid; @@ -57,6 +70,7 @@ public JumpPointSearchPathfinder(IMapGrid mapGrid, IHeuristic heuristic) return path; } + /// public IEnumerable<(short X, short Y)> FindPath((short X, short Y) start, (short X, short Y) end) { if (Cache.TryGetValue((start, end), out IEnumerable<(short X, short Y)>? cachedList)) @@ -149,6 +163,13 @@ private void IdentifySuccessors(JumpNode node, JumpNode?[,] nodes, (short X, sho } } + /// + /// Recursively searches for jump points in the specified direction. + /// + /// The current position to evaluate. + /// The previous position (determines search direction). + /// The destination position. + /// The jump point coordinates if found; otherwise, null. public (short X, short Y)? Jump((short X, short Y) current, (short X, short Y) proposed, (short X, short Y) end) { var x = current.X; From 94ddecf43dadb7b04f0ae45f658168c7ed0898b8 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 15 Nov 2025 02:21:41 +0000 Subject: [PATCH 06/21] Add XML documentation to Brushfire namespace classes - Documented Node class with all properties (Closed, Parent, F, Position, Value) - Documented JumpNode class with JPS-specific properties (G, H, Opened) - Documented BrushFire struct with all properties and indexer - Documented IMapGridExtension static class with extension methods: - GetNeighbors: Gets neighboring cells in the grid - LoadBrushFire: Computes brushfire distance map All public APIs now have complete XML documentation. --- src/NosCore.PathFinder/Brushfire/BrushFire.cs | 29 ++++++++++++++++++- .../Brushfire/IMapGridExtension.cs | 18 ++++++++++++ src/NosCore.PathFinder/Brushfire/JumpNode.cs | 18 ++++++++++++ src/NosCore.PathFinder/Brushfire/Node.cs | 25 +++++++++++++++- 4 files changed, 88 insertions(+), 2 deletions(-) diff --git a/src/NosCore.PathFinder/Brushfire/BrushFire.cs b/src/NosCore.PathFinder/Brushfire/BrushFire.cs index cfcc9dd..6687ff6 100644 --- a/src/NosCore.PathFinder/Brushfire/BrushFire.cs +++ b/src/NosCore.PathFinder/Brushfire/BrushFire.cs @@ -8,9 +8,18 @@ namespace NosCore.PathFinder.Brushfire { + /// + /// Represents a brushfire pathfinding data structure containing pre-computed distance information. + /// public readonly struct BrushFire { - + /// + /// Initializes a new instance of the struct. + /// + /// The origin point of the brushfire. + /// The grid containing computed node information. + /// The width of the grid. + /// The length of the grid. public BrushFire((short X, short Y) origin, Dictionary<(short X, short Y), Node?> brushFireGrid, short width, short length) { @@ -20,14 +29,32 @@ public BrushFire((short X, short Y) origin, Dictionary<(short X, short Y), Node? Width = width; } + /// + /// Gets the origin point of the brushfire. + /// public (short X, short Y) Origin { get; } + /// + /// Gets the grid containing computed node information. + /// public Dictionary<(short X, short Y), Node?> Grid { get; } + /// + /// Gets the length of the grid. + /// public short Length { get; } + /// + /// Gets the width of the grid. + /// public short Width { get; } + /// + /// Gets the value at the specified coordinates. + /// + /// The X coordinate. + /// The Y coordinate. + /// The value at the specified position, or null if not found. public double? this[short x, short y] => Grid.ContainsKey((x, y)) ? Grid[(x, y)]?.Value : null; } } diff --git a/src/NosCore.PathFinder/Brushfire/IMapGridExtension.cs b/src/NosCore.PathFinder/Brushfire/IMapGridExtension.cs index 3ba20e3..fb41594 100644 --- a/src/NosCore.PathFinder/Brushfire/IMapGridExtension.cs +++ b/src/NosCore.PathFinder/Brushfire/IMapGridExtension.cs @@ -10,6 +10,9 @@ namespace NosCore.PathFinder.Brushfire { + /// + /// Extension methods for IMapGrid interface providing neighbor and brushfire functionality. + /// public static class IMapGridExtension { private static readonly List<(short X, short Y)> Neighbours = new List<(short, short)> { @@ -18,6 +21,13 @@ public static class IMapGridExtension (-1, 1), (0, 1), (1, 1) }; + /// + /// Gets the neighboring cells of a given cell in the grid. + /// + /// The map grid. + /// The cell to get neighbors for. + /// If true, includes non-walkable cells; otherwise, only returns walkable neighbors. + /// An enumerable sequence of neighboring cell positions. public static IEnumerable<(short X, short Y)> GetNeighbors(this IMapGrid grid, (short X, short Y) cell, bool includeWalls = false) { return Neighbours.Where(delta => @@ -31,6 +41,14 @@ public static class IMapGridExtension }).Select(delta => ((short)(cell.X + delta.X), (short)(cell.Y + delta.Y))); } + /// + /// Computes a brushfire distance map from a given origin point. + /// + /// The map grid to compute the brushfire on. + /// The origin point for the brushfire. + /// The heuristic to use for distance calculations. + /// The maximum distance to compute (default is 22). + /// A BrushFire structure containing pre-computed distance information. public static BrushFire LoadBrushFire(this IMapGrid mapGrid, (short X, short Y) user, IHeuristic heuristic, short maxDistance = 22) { if (user.X < 0 || user.X >= mapGrid.Width || diff --git a/src/NosCore.PathFinder/Brushfire/JumpNode.cs b/src/NosCore.PathFinder/Brushfire/JumpNode.cs index 35e7939..97fd81d 100644 --- a/src/NosCore.PathFinder/Brushfire/JumpNode.cs +++ b/src/NosCore.PathFinder/Brushfire/JumpNode.cs @@ -8,16 +8,34 @@ namespace NosCore.PathFinder.Brushfire { + /// + /// Represents a node used in Jump Point Search pathfinding algorithm. + /// Extends the base Node class with additional properties for JPS. + /// public class JumpNode : Node { + /// + /// Initializes a new instance of the class. + /// + /// The position of the node in the grid. + /// The value associated with the node. public JumpNode((short X, short Y) position, double? value) : base(position, value) { } + /// + /// Gets or sets the G score (cost from start to this node). + /// public double G { get; set; } + /// + /// Gets or sets the H score (heuristic cost from this node to the goal). + /// public double? H { get; set; } + /// + /// Gets or sets a value indicating whether this node has been opened for evaluation. + /// public bool Opened { get; set; } } } \ No newline at end of file diff --git a/src/NosCore.PathFinder/Brushfire/Node.cs b/src/NosCore.PathFinder/Brushfire/Node.cs index 6d863b6..82afcee 100644 --- a/src/NosCore.PathFinder/Brushfire/Node.cs +++ b/src/NosCore.PathFinder/Brushfire/Node.cs @@ -8,22 +8,45 @@ namespace NosCore.PathFinder.Brushfire { + /// + /// Represents a node in the pathfinding grid with position and value information. + /// public class Node { + /// + /// Initializes a new instance of the class. + /// + /// The position of the node in the grid. + /// The value associated with the node. public Node((short X, short Y) position, double? value) { Value = value; Position = position; } - + + /// + /// Gets or sets a value indicating whether this node has been processed and closed. + /// public bool Closed { get; set; } + /// + /// Gets or sets the parent node in the path. + /// public Node? Parent { get; set; } + /// + /// Gets or sets the F score (G + H) used in A* pathfinding. + /// public double F { get; set; } + /// + /// Gets or sets the position of the node in the grid. + /// public (short X, short Y) Position { get; set; } + /// + /// Gets or sets the value associated with this node. + /// public double? Value { get; set; } } } \ No newline at end of file From cc524228352f5104d0904ec93f60540bd6e99c9e Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 15 Nov 2025 03:32:14 +0000 Subject: [PATCH 07/21] Update System.Drawing.Common to version 10.0.0 - Upgraded from 4.5.0 to 10.0.0 for .NET 10 compatibility - Fixes DllNotFoundException on Linux with libdl - Resolves critical security vulnerability (GHSA-rxg9-xrhp-64gj) The old version had compatibility issues with .NET 10 on Linux and caused tests to fail with DllNotFoundException when loading System.Drawing.Common. --- test/NosCore.PathFinder.Tests/NosCore.PathFinder.Tests.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/NosCore.PathFinder.Tests/NosCore.PathFinder.Tests.csproj b/test/NosCore.PathFinder.Tests/NosCore.PathFinder.Tests.csproj index cf96f30..b81e551 100644 --- a/test/NosCore.PathFinder.Tests/NosCore.PathFinder.Tests.csproj +++ b/test/NosCore.PathFinder.Tests/NosCore.PathFinder.Tests.csproj @@ -13,7 +13,7 @@ - + From 395ba89aa5b13f3f8410a7c1109a59e3df63e5d3 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 15 Nov 2025 03:35:13 +0000 Subject: [PATCH 08/21] Install libgdiplus for System.Drawing.Common on Linux System.Drawing.Common 10.0.0 requires the libgdiplus native library on Linux. Added installation step in GitHub Actions workflow to ensure tests can run successfully. --- .github/workflows/dotnet.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 7bff4a8..113ac78 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -24,7 +24,12 @@ jobs: if [[ v${{ github.event.ref }} =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then echo "match=true" >> $GITHUB_OUTPUT fi - + + - name: Install libgdiplus + run: | + sudo apt-get update + sudo apt-get install -y libgdiplus + - name: Run Unit Tests run: | dotnet restore From fbf499c1b27a2b9e9cb2d5d6e4f4d14f505c6e65 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 15 Nov 2025 03:37:34 +0000 Subject: [PATCH 09/21] Update all NuGet packages to latest versions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Package updates: - Mapster: 7.3.0 → 7.4.0 - Serilog: 2.12.0 → 4.3.0 - NetEscapades.Configuration.Yaml: 2.2.0 → 3.1.0 - ApprovalTests: 5.7.3 → 7.0.0 - Microsoft.NET.Test.Sdk: 17.4.0 → 18.0.1 - Moq: 4.18.2 → 4.20.72 - MSTest.TestAdapter: 2.2.10 → 4.0.2 - MSTest.TestFramework: 2.2.10 → 4.0.2 - BenchmarkDotNet: 0.13.2 → 0.15.7 All packages are now at their latest stable versions compatible with .NET 10. --- .../NosCore.PathFinder.Gui.csproj | 2 +- src/NosCore.PathFinder/NosCore.PathFinder.csproj | 4 ++-- .../NosCore.PathFinder.Benchmark.csproj | 2 +- .../NosCore.PathFinder.Tests.csproj | 10 +++++----- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/NosCore.PathFinder.Gui/NosCore.PathFinder.Gui.csproj b/src/NosCore.PathFinder.Gui/NosCore.PathFinder.Gui.csproj index 9c5ae83..dc325f2 100644 --- a/src/NosCore.PathFinder.Gui/NosCore.PathFinder.Gui.csproj +++ b/src/NosCore.PathFinder.Gui/NosCore.PathFinder.Gui.csproj @@ -15,7 +15,7 @@ - + diff --git a/src/NosCore.PathFinder/NosCore.PathFinder.csproj b/src/NosCore.PathFinder/NosCore.PathFinder.csproj index a9bc8c9..b77b352 100644 --- a/src/NosCore.PathFinder/NosCore.PathFinder.csproj +++ b/src/NosCore.PathFinder/NosCore.PathFinder.csproj @@ -28,10 +28,10 @@ - + - + diff --git a/test/NosCore.PathFinder.Benchmark/NosCore.PathFinder.Benchmark/NosCore.PathFinder.Benchmark.csproj b/test/NosCore.PathFinder.Benchmark/NosCore.PathFinder.Benchmark/NosCore.PathFinder.Benchmark.csproj index a496211..f166323 100644 --- a/test/NosCore.PathFinder.Benchmark/NosCore.PathFinder.Benchmark/NosCore.PathFinder.Benchmark.csproj +++ b/test/NosCore.PathFinder.Benchmark/NosCore.PathFinder.Benchmark/NosCore.PathFinder.Benchmark.csproj @@ -6,7 +6,7 @@ - + diff --git a/test/NosCore.PathFinder.Tests/NosCore.PathFinder.Tests.csproj b/test/NosCore.PathFinder.Tests/NosCore.PathFinder.Tests.csproj index b81e551..9d9fc97 100644 --- a/test/NosCore.PathFinder.Tests/NosCore.PathFinder.Tests.csproj +++ b/test/NosCore.PathFinder.Tests/NosCore.PathFinder.Tests.csproj @@ -7,12 +7,12 @@ - + - - - - + + + + From 1bbd792ead800931bb2ad2a773c630de1dfc3ae4 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 15 Nov 2025 03:41:11 +0000 Subject: [PATCH 10/21] Fix security vulnerabilities in transitive dependencies MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Security fixes: - Override System.Drawing.Common 4.5.0 → 10.0.0 (fixes critical vulnerability GHSA-rxg9-xrhp-64gj) - Override Microsoft.IdentityModel.JsonWebTokens 6.10.0 → 8.14.0 (fixes moderate vulnerability GHSA-59j7-ghrg-fj52) - Override System.IdentityModel.Tokens.Jwt 6.10.0 → 8.14.0 (fixes moderate vulnerability GHSA-59j7-ghrg-fj52) Other improvements: - Removed Microsoft.Extensions.Configuration.Binder (unnecessary in .NET 10) --- src/NosCore.PathFinder.Gui/NosCore.PathFinder.Gui.csproj | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/NosCore.PathFinder.Gui/NosCore.PathFinder.Gui.csproj b/src/NosCore.PathFinder.Gui/NosCore.PathFinder.Gui.csproj index dc325f2..3ac7bfc 100644 --- a/src/NosCore.PathFinder.Gui/NosCore.PathFinder.Gui.csproj +++ b/src/NosCore.PathFinder.Gui/NosCore.PathFinder.Gui.csproj @@ -14,12 +14,14 @@ - + + + From 67a0cd5b14320d63abaf4eeb1b530810802fdf7b Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 15 Nov 2025 03:45:18 +0000 Subject: [PATCH 11/21] Add ldconfig after libgdiplus installation Run ldconfig to update the dynamic linker cache after installing libgdiplus, ensuring the library is properly registered and discoverable by .NET runtime. --- .github/workflows/dotnet.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 113ac78..b12e774 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -29,6 +29,7 @@ jobs: run: | sudo apt-get update sudo apt-get install -y libgdiplus + sudo ldconfig - name: Run Unit Tests run: | From 02840ac50e380eac92a1492095c9b7b5e2694793 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 15 Nov 2025 05:22:23 +0000 Subject: [PATCH 12/21] Add EnableWindowsTargeting to test project for cross-platform System.Drawing support --- test/NosCore.PathFinder.Tests/NosCore.PathFinder.Tests.csproj | 1 + 1 file changed, 1 insertion(+) diff --git a/test/NosCore.PathFinder.Tests/NosCore.PathFinder.Tests.csproj b/test/NosCore.PathFinder.Tests/NosCore.PathFinder.Tests.csproj index 9d9fc97..797fa40 100644 --- a/test/NosCore.PathFinder.Tests/NosCore.PathFinder.Tests.csproj +++ b/test/NosCore.PathFinder.Tests/NosCore.PathFinder.Tests.csproj @@ -4,6 +4,7 @@ net10.0 enable false + true From eb7866b729661fff1a6123d744beb689d7c8aadb Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 15 Nov 2025 05:22:46 +0000 Subject: [PATCH 13/21] Create symbolic link for libgdiplus to fix System.Drawing.Common on Linux .NET runtime looks for 'gdiplus.dll' but libgdiplus installs as 'libgdiplus.so' on Linux. Creating a symbolic link allows the runtime to find the library correctly. --- .github/workflows/dotnet.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index b12e774..e6e3993 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -30,6 +30,8 @@ jobs: sudo apt-get update sudo apt-get install -y libgdiplus sudo ldconfig + # Create symbolic link for .NET runtime to find the library + sudo ln -sf /usr/lib/libgdiplus.so /usr/lib/gdiplus.dll - name: Run Unit Tests run: | From a7488566928a57c08ca85fe8154aac4d66a39256 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 15 Nov 2025 05:25:33 +0000 Subject: [PATCH 14/21] Enable System.Drawing.Common Unix support via runtime configuration System.Drawing.Common 10.0.0 explicitly requires opt-in for non-Windows platforms. Adding runtimeconfig.template.json with System.Drawing.EnableUnixSupport=true to allow tests using System.Drawing to run on Linux CI runners. --- test/NosCore.PathFinder.Tests/runtimeconfig.template.json | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 test/NosCore.PathFinder.Tests/runtimeconfig.template.json diff --git a/test/NosCore.PathFinder.Tests/runtimeconfig.template.json b/test/NosCore.PathFinder.Tests/runtimeconfig.template.json new file mode 100644 index 0000000..6906ea9 --- /dev/null +++ b/test/NosCore.PathFinder.Tests/runtimeconfig.template.json @@ -0,0 +1,5 @@ +{ + "configProperties": { + "System.Drawing.EnableUnixSupport": true + } +} From 467bbf476aabd3346e179e294a160957c24529fc Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 18 Nov 2025 22:16:37 +0000 Subject: [PATCH 15/21] Use RuntimeHostConfigurationOption for System.Drawing Unix support Replace runtimeconfig.template.json with explicit RuntimeHostConfigurationOption in the project file for better control over runtime configuration. --- .../NosCore.PathFinder.Tests/NosCore.PathFinder.Tests.csproj | 4 ++++ test/NosCore.PathFinder.Tests/runtimeconfig.template.json | 5 ----- 2 files changed, 4 insertions(+), 5 deletions(-) delete mode 100644 test/NosCore.PathFinder.Tests/runtimeconfig.template.json diff --git a/test/NosCore.PathFinder.Tests/NosCore.PathFinder.Tests.csproj b/test/NosCore.PathFinder.Tests/NosCore.PathFinder.Tests.csproj index 797fa40..921856e 100644 --- a/test/NosCore.PathFinder.Tests/NosCore.PathFinder.Tests.csproj +++ b/test/NosCore.PathFinder.Tests/NosCore.PathFinder.Tests.csproj @@ -7,6 +7,10 @@ true + + + + diff --git a/test/NosCore.PathFinder.Tests/runtimeconfig.template.json b/test/NosCore.PathFinder.Tests/runtimeconfig.template.json deleted file mode 100644 index 6906ea9..0000000 --- a/test/NosCore.PathFinder.Tests/runtimeconfig.template.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "configProperties": { - "System.Drawing.EnableUnixSupport": true - } -} From 274f38394cebcf266d458d537489050c1d05ebd3 Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 18 Nov 2025 22:18:06 +0000 Subject: [PATCH 16/21] Fix build warnings - Add MSTest parallelization configuration to suppress MSTEST0001 - Suppress CA1416 platform compatibility warnings (Unix support is explicitly enabled) - Fix CS8604 nullable reference warning in NosCoreContext constructor --- src/NosCore.PathFinder.Gui/Database/NosCoreContext.cs | 2 +- test/NosCore.PathFinder.Tests/.editorconfig | 6 ++++++ test/NosCore.PathFinder.Tests/AssemblyInfo.cs | 3 +++ 3 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 test/NosCore.PathFinder.Tests/.editorconfig create mode 100644 test/NosCore.PathFinder.Tests/AssemblyInfo.cs diff --git a/src/NosCore.PathFinder.Gui/Database/NosCoreContext.cs b/src/NosCore.PathFinder.Gui/Database/NosCoreContext.cs index e2ae8ce..85f3b55 100644 --- a/src/NosCore.PathFinder.Gui/Database/NosCoreContext.cs +++ b/src/NosCore.PathFinder.Gui/Database/NosCoreContext.cs @@ -11,7 +11,7 @@ namespace NosCore.PathFinder.Gui.Database { public class NosCoreContext : DbContext { - public NosCoreContext(DbContextOptions? options) : base(options) + public NosCoreContext(DbContextOptions options) : base(options) { } diff --git a/test/NosCore.PathFinder.Tests/.editorconfig b/test/NosCore.PathFinder.Tests/.editorconfig new file mode 100644 index 0000000..86d5290 --- /dev/null +++ b/test/NosCore.PathFinder.Tests/.editorconfig @@ -0,0 +1,6 @@ +root = false + +[*.cs] +# Suppress CA1416: Platform compatibility warnings for System.Drawing +# We explicitly enable Unix support via RuntimeHostConfigurationOption +dotnet_diagnostic.CA1416.severity = none diff --git a/test/NosCore.PathFinder.Tests/AssemblyInfo.cs b/test/NosCore.PathFinder.Tests/AssemblyInfo.cs new file mode 100644 index 0000000..38707ae --- /dev/null +++ b/test/NosCore.PathFinder.Tests/AssemblyInfo.cs @@ -0,0 +1,3 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; + +[assembly: Parallelize(Workers = 0, Scope = ExecutionScope.MethodLevel)] From b2d775c7de92a0b0ba30a376bab9b4739968259d Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 19 Nov 2025 06:31:55 +0000 Subject: [PATCH 17/21] Use environment variable for System.Drawing Unix support - Add DOTNET_SYSTEM_DRAWING_ENABLEUNIXSUPPORT environment variable to GitHub Actions - Fix CS8604 null reference warning in DataAccessHelper.CreateContext() - Environment variable approach is more reliable than RuntimeHostConfigurationOption for static initializers --- .github/workflows/dotnet.yml | 2 ++ src/NosCore.PathFinder.Gui/Database/DataAccessHelper.cs | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index e6e3993..17dcdb3 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -34,6 +34,8 @@ jobs: sudo ln -sf /usr/lib/libgdiplus.so /usr/lib/gdiplus.dll - name: Run Unit Tests + env: + DOTNET_SYSTEM_DRAWING_ENABLEUNIXSUPPORT: 1 run: | dotnet restore dotnet build diff --git a/src/NosCore.PathFinder.Gui/Database/DataAccessHelper.cs b/src/NosCore.PathFinder.Gui/Database/DataAccessHelper.cs index 8f5fd2a..c1f6d11 100644 --- a/src/NosCore.PathFinder.Gui/Database/DataAccessHelper.cs +++ b/src/NosCore.PathFinder.Gui/Database/DataAccessHelper.cs @@ -23,6 +23,10 @@ public class DataAccessHelper /// public DbContext CreateContext() { + if (_option == null) + { + throw new InvalidOperationException("Database options must be initialized before creating a context. Call Initialize() first."); + } return new NosCoreContext(_option); } From 70f847b2d55bce75365fb4cd13f01d6285726e10 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 19 Nov 2025 06:39:19 +0000 Subject: [PATCH 18/21] Add ModuleInitializer to enable System.Drawing Unix support - Use ModuleInitializer to set AppContext switch before static initializers run - Fix environment variable name format (DOTNET_System_Drawing_EnableUnixSupport) - ModuleInitializer runs before any static constructors, ensuring Unix support is enabled early --- .github/workflows/dotnet.yml | 2 +- test/NosCore.PathFinder.Tests/AssemblyInfo.cs | 11 +++++++++++ 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 17dcdb3..ff76224 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -35,7 +35,7 @@ jobs: - name: Run Unit Tests env: - DOTNET_SYSTEM_DRAWING_ENABLEUNIXSUPPORT: 1 + DOTNET_System_Drawing_EnableUnixSupport: true run: | dotnet restore dotnet build diff --git a/test/NosCore.PathFinder.Tests/AssemblyInfo.cs b/test/NosCore.PathFinder.Tests/AssemblyInfo.cs index 38707ae..ca583ec 100644 --- a/test/NosCore.PathFinder.Tests/AssemblyInfo.cs +++ b/test/NosCore.PathFinder.Tests/AssemblyInfo.cs @@ -1,3 +1,14 @@ +using System.Runtime.CompilerServices; using Microsoft.VisualStudio.TestTools.UnitTesting; [assembly: Parallelize(Workers = 0, Scope = ExecutionScope.MethodLevel)] + +internal static class ModuleInitializer +{ + [ModuleInitializer] + internal static void Initialize() + { + // Enable System.Drawing.Common Unix support before any static initializers run + System.AppContext.SetSwitch("System.Drawing.EnableUnixSupport", true); + } +} From e0bd7e75780900faef50f382b0202f58d7a0b91b Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 19 Nov 2025 06:42:49 +0000 Subject: [PATCH 19/21] Convert StringFormat to lazy initialization - Change StringFormat from static field to lazy-initialized property - Defers System.Drawing.Common initialization until after ModuleInitializer runs - Ensures AppContext.SetSwitch is called before any GDI+ interop occurs --- test/NosCore.PathFinder.Tests/TestHelper.cs | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/test/NosCore.PathFinder.Tests/TestHelper.cs b/test/NosCore.PathFinder.Tests/TestHelper.cs index f638f30..c678fa2 100644 --- a/test/NosCore.PathFinder.Tests/TestHelper.cs +++ b/test/NosCore.PathFinder.Tests/TestHelper.cs @@ -39,11 +39,23 @@ public static void VerifyFile(string linearPathfinderPng, Bitmap bitmap, List Date: Wed, 19 Nov 2025 06:47:23 +0000 Subject: [PATCH 20/21] Skip System.Drawing visualization tests on non-Windows platforms - System.Drawing.Common only supports Windows in .NET 10+ - Unix support was removed in .NET 7 and is not available in .NET 10 - Visualization tests marked as Inconclusive on Linux/macOS - Core pathfinding logic tests still run on all platforms --- .github/workflows/dotnet.yml | 3 +-- test/NosCore.PathFinder.Tests/AssemblyInfo.cs | 2 ++ test/NosCore.PathFinder.Tests/BrushFireTests.cs | 7 +++++++ test/NosCore.PathFinder.Tests/GoalBasedPathfinderTests.cs | 7 +++++++ .../JumpPointSearchPathfinderTests.cs | 7 +++++++ 5 files changed, 24 insertions(+), 2 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index ff76224..aa5f087 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -34,11 +34,10 @@ jobs: sudo ln -sf /usr/lib/libgdiplus.so /usr/lib/gdiplus.dll - name: Run Unit Tests - env: - DOTNET_System_Drawing_EnableUnixSupport: true run: | dotnet restore dotnet build + export DOTNET_SYSTEM_DRAWING_ENABLEUNIXSUPPORT=1 dotnet test test/NosCore.PathFinder.Tests -v m - name: Build Artifact diff --git a/test/NosCore.PathFinder.Tests/AssemblyInfo.cs b/test/NosCore.PathFinder.Tests/AssemblyInfo.cs index ca583ec..2478ab6 100644 --- a/test/NosCore.PathFinder.Tests/AssemblyInfo.cs +++ b/test/NosCore.PathFinder.Tests/AssemblyInfo.cs @@ -9,6 +9,8 @@ internal static class ModuleInitializer internal static void Initialize() { // Enable System.Drawing.Common Unix support before any static initializers run + // Try multiple switch names for compatibility System.AppContext.SetSwitch("System.Drawing.EnableUnixSupport", true); + System.Environment.SetEnvironmentVariable("DOTNET_SYSTEM_DRAWING_ENABLEUNIXSUPPORT", "1"); } } diff --git a/test/NosCore.PathFinder.Tests/BrushFireTests.cs b/test/NosCore.PathFinder.Tests/BrushFireTests.cs index 4534c38..c883395 100644 --- a/test/NosCore.PathFinder.Tests/BrushFireTests.cs +++ b/test/NosCore.PathFinder.Tests/BrushFireTests.cs @@ -21,6 +21,13 @@ public class BrushFireTests [TestMethod] public void Test_BrushFire() { + // System.Drawing.Common only supports Windows in .NET 10+ + if (!System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(System.Runtime.InteropServices.OSPlatform.Windows)) + { + Assert.Inconclusive("System.Drawing visualization tests only run on Windows (.NET 10+)"); + return; + } + (short X, short Y) characterPosition = (6, 10); var brushFire = _map.LoadBrushFire(characterPosition, new OctileDistanceHeuristic()); var bitmap = new Bitmap(_map.Width * TestHelper.Scale, _map.Height * TestHelper.Scale); diff --git a/test/NosCore.PathFinder.Tests/GoalBasedPathfinderTests.cs b/test/NosCore.PathFinder.Tests/GoalBasedPathfinderTests.cs index 8da429a..1616c58 100644 --- a/test/NosCore.PathFinder.Tests/GoalBasedPathfinderTests.cs +++ b/test/NosCore.PathFinder.Tests/GoalBasedPathfinderTests.cs @@ -35,6 +35,13 @@ public GoalBasedPathfinderTests() [TestMethod] public void Test_GoalBasedPathfinder() { + // System.Drawing.Common only supports Windows in .NET 10+ + if (!System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(System.Runtime.InteropServices.OSPlatform.Windows)) + { + Assert.Inconclusive("System.Drawing visualization tests only run on Windows (.NET 10+)"); + return; + } + var bitmap = new Bitmap(_map.Width * TestHelper.Scale, _map.Height * TestHelper.Scale); (short X, short Y) target = (15, 16); var listPixel = new List(); diff --git a/test/NosCore.PathFinder.Tests/JumpPointSearchPathfinderTests.cs b/test/NosCore.PathFinder.Tests/JumpPointSearchPathfinderTests.cs index 41c6fcb..ef987ba 100644 --- a/test/NosCore.PathFinder.Tests/JumpPointSearchPathfinderTests.cs +++ b/test/NosCore.PathFinder.Tests/JumpPointSearchPathfinderTests.cs @@ -31,6 +31,13 @@ public JumpPointSearchPathfinderTests() [TestMethod] public void Test_JumpPointSearchPathfinder() { + // System.Drawing.Common only supports Windows in .NET 10+ + if (!System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(System.Runtime.InteropServices.OSPlatform.Windows)) + { + Assert.Inconclusive("System.Drawing visualization tests only run on Windows (.NET 10+)"); + return; + } + var bitmap = new Bitmap(_map.Width * TestHelper.Scale, _map.Height * TestHelper.Scale); (short X, short Y) target = (15, 16); var listPixel = new List(); From 9cf19d59ba98a8735badb8aa93959cd89e1fb966 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 19 Nov 2025 06:48:51 +0000 Subject: [PATCH 21/21] Use System.Drawing.Common 6.0.0 for cross-platform support - Downgrade from 10.0.0 to 6.0.0 which has Unix support - Remove platform-conditional test guards - Keep RuntimeHostConfigurationOption and ModuleInitializer for Unix support - System.Drawing.Common 6.0.0 is the last version with EnableUnixSupport --- test/NosCore.PathFinder.Tests/BrushFireTests.cs | 7 ------- test/NosCore.PathFinder.Tests/GoalBasedPathfinderTests.cs | 7 ------- .../JumpPointSearchPathfinderTests.cs | 7 ------- .../NosCore.PathFinder.Tests.csproj | 2 +- 4 files changed, 1 insertion(+), 22 deletions(-) diff --git a/test/NosCore.PathFinder.Tests/BrushFireTests.cs b/test/NosCore.PathFinder.Tests/BrushFireTests.cs index c883395..4534c38 100644 --- a/test/NosCore.PathFinder.Tests/BrushFireTests.cs +++ b/test/NosCore.PathFinder.Tests/BrushFireTests.cs @@ -21,13 +21,6 @@ public class BrushFireTests [TestMethod] public void Test_BrushFire() { - // System.Drawing.Common only supports Windows in .NET 10+ - if (!System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(System.Runtime.InteropServices.OSPlatform.Windows)) - { - Assert.Inconclusive("System.Drawing visualization tests only run on Windows (.NET 10+)"); - return; - } - (short X, short Y) characterPosition = (6, 10); var brushFire = _map.LoadBrushFire(characterPosition, new OctileDistanceHeuristic()); var bitmap = new Bitmap(_map.Width * TestHelper.Scale, _map.Height * TestHelper.Scale); diff --git a/test/NosCore.PathFinder.Tests/GoalBasedPathfinderTests.cs b/test/NosCore.PathFinder.Tests/GoalBasedPathfinderTests.cs index 1616c58..8da429a 100644 --- a/test/NosCore.PathFinder.Tests/GoalBasedPathfinderTests.cs +++ b/test/NosCore.PathFinder.Tests/GoalBasedPathfinderTests.cs @@ -35,13 +35,6 @@ public GoalBasedPathfinderTests() [TestMethod] public void Test_GoalBasedPathfinder() { - // System.Drawing.Common only supports Windows in .NET 10+ - if (!System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(System.Runtime.InteropServices.OSPlatform.Windows)) - { - Assert.Inconclusive("System.Drawing visualization tests only run on Windows (.NET 10+)"); - return; - } - var bitmap = new Bitmap(_map.Width * TestHelper.Scale, _map.Height * TestHelper.Scale); (short X, short Y) target = (15, 16); var listPixel = new List(); diff --git a/test/NosCore.PathFinder.Tests/JumpPointSearchPathfinderTests.cs b/test/NosCore.PathFinder.Tests/JumpPointSearchPathfinderTests.cs index ef987ba..41c6fcb 100644 --- a/test/NosCore.PathFinder.Tests/JumpPointSearchPathfinderTests.cs +++ b/test/NosCore.PathFinder.Tests/JumpPointSearchPathfinderTests.cs @@ -31,13 +31,6 @@ public JumpPointSearchPathfinderTests() [TestMethod] public void Test_JumpPointSearchPathfinder() { - // System.Drawing.Common only supports Windows in .NET 10+ - if (!System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(System.Runtime.InteropServices.OSPlatform.Windows)) - { - Assert.Inconclusive("System.Drawing visualization tests only run on Windows (.NET 10+)"); - return; - } - var bitmap = new Bitmap(_map.Width * TestHelper.Scale, _map.Height * TestHelper.Scale); (short X, short Y) target = (15, 16); var listPixel = new List(); diff --git a/test/NosCore.PathFinder.Tests/NosCore.PathFinder.Tests.csproj b/test/NosCore.PathFinder.Tests/NosCore.PathFinder.Tests.csproj index 921856e..90e0997 100644 --- a/test/NosCore.PathFinder.Tests/NosCore.PathFinder.Tests.csproj +++ b/test/NosCore.PathFinder.Tests/NosCore.PathFinder.Tests.csproj @@ -18,7 +18,7 @@ - +