From 0393e7a6db0462f10280fcc6989060eafc5a564d Mon Sep 17 00:00:00 2001 From: binarylab2022-del Date: Tue, 14 Jul 2026 15:55:55 +0100 Subject: [PATCH 1/2] Fix remaining nullable warnings --- WinDama1.0/BoardRenderer.cs | 11 ++++++---- WinDama1.0/MainWindow.xaml.cs | 39 ++++++++++++++++++++++------------- 2 files changed, 32 insertions(+), 18 deletions(-) diff --git a/WinDama1.0/BoardRenderer.cs b/WinDama1.0/BoardRenderer.cs index 784dd4d..620de3e 100644 --- a/WinDama1.0/BoardRenderer.cs +++ b/WinDama1.0/BoardRenderer.cs @@ -51,7 +51,7 @@ public void Draw( int? selectedRow, int? selectedColumn, IReadOnlyList highlightedLegalMoves, - Move lastMove) + Move? lastMove) { if (canvas == null || board == null) { @@ -70,10 +70,13 @@ public void Draw( for (int column = 0; column < board.GetLength(1); column++) { bool isSelectedSquare = pieceSelected && selectedRow == row && selectedColumn == column; - Move highlightedMove = highlightedLegalMoves?.FirstOrDefault(m => m.End.Item1 == row && m.End.Item2 == column); + Move? highlightedMove = + highlightedLegalMoves.FirstOrDefault( + m => m.End.Item1 == row && m.End.Item2 == column); + bool isMoveTarget = highlightedMove != null; - bool isCaptureTarget = isMoveTarget && highlightedMove.CapturedPieces.Count > 0; - bool isLastMoveStart = lastMove != null && lastMove.Start.Item1 == row && lastMove.Start.Item2 == column; + bool isCaptureTarget = + highlightedMove?.CapturedPieces.Count > 0; bool isLastMoveStart = lastMove != null && lastMove.Start.Item1 == row && lastMove.Start.Item2 == column; bool isLastMoveEnd = lastMove != null && lastMove.End.Item1 == row && lastMove.End.Item2 == column; bool isLastCapturedSquare = lastMove != null && lastMove.CapturedPieces.Any(c => c.Item1 == row && c.Item2 == column); bool isLastMoveSquare = isLastMoveStart || isLastMoveEnd; diff --git a/WinDama1.0/MainWindow.xaml.cs b/WinDama1.0/MainWindow.xaml.cs index 9b23021..aeaec21 100644 --- a/WinDama1.0/MainWindow.xaml.cs +++ b/WinDama1.0/MainWindow.xaml.cs @@ -1,20 +1,20 @@ +using Microsoft.Win32; using System; using System.Collections.Generic; +using System.ComponentModel; +using System.IO; using System.Linq; +using System.Media; +using System.Text; +using System.Text.Json; +using System.Threading; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Input; -using System.Media; using System.Windows.Threading; -using System.Threading; -using System.IO; -using System.Text; -using System.Text.Json; -using System.ComponentModel; -using Microsoft.Win32; - using WinDama.Core; +using static System.Net.Mime.MediaTypeNames; namespace WinDama { /// @@ -1080,7 +1080,9 @@ private void UpdateAnalysisFields(SearchResult? result) string summary = result == null ? string.Empty - : analysisPanelUpdater?.UpdateFromResult(result, GetSearchModeLabel(result.Mode)); + : (analysisPanelUpdater?.UpdateFromResult( + result, + GetSearchModeLabel(result.Mode)) ?? string.Empty); if (result == null) { @@ -1101,7 +1103,11 @@ private void UpdateAnalysisProgress(WinDama.Core.SearchProgress progress) return; } - string summary = analysisPanelUpdater?.UpdateFromProgress(progress, GetSearchModeLabel(selectedAiSearchMode)); + string summary = + analysisPanelUpdater?.UpdateFromProgress( + progress, + GetSearchModeLabel(selectedAiSearchMode)) + ?? string.Empty; if (!string.IsNullOrWhiteSpace(summary)) { SetAnalysisSummary(summary); @@ -1256,7 +1262,7 @@ private void SavePositionButton_Click(object sender, RoutedEventArgs e) try { Directory.CreateDirectory(DefaultTestPositionsFolder); - string suggestedName = BoardEditorController.BuildSafePositionFileName(PositionNameTextBox?.Text); + string suggestedName = BoardEditorController.BuildSafePositionFileName(PositionNameTextBox.Text ?? string.Empty); SaveFileDialog dialog = new SaveFileDialog { Title = "Save WinDama test position", @@ -1383,7 +1389,7 @@ private void SynchronizeEditedPosition(string reason, bool saveUndo, bool resetL CancelBackgroundPositionAnalysis(); ClearMoveSelection(redraw: false); - Move lastMoveForState = resetLastMove ? null : lastMove; + Move? lastMoveForState = resetLastMove ? null : lastMove; gameController.SetGameMode(selectedGameMode); gameController.RestoreState(board, currentPlayer, isGameOver: false, lastMove: lastMoveForState); SynchronizeFieldsFromGameController(); @@ -1499,7 +1505,9 @@ private async void StartBackgroundPositionAnalysis(string reason) { if (!Dispatcher.CheckAccess()) { - Dispatcher.BeginInvoke(new Action(() => StartBackgroundPositionAnalysis(reason))); + _ = Dispatcher.BeginInvoke( + new Action(() => StartBackgroundPositionAnalysis(reason))); + return; } @@ -3394,7 +3402,10 @@ private void HandleSquareClick(int row, int column) // Empty target square after a piece was selected. if (pieceSelected && selectedRow.HasValue && selectedColumn.HasValue) { - Move validMove = highlightedLegalMoves.FirstOrDefault(move => move.End.Item1 == row && move.End.Item2 == column); + Move? validMove = + highlightedLegalMoves.FirstOrDefault( + move => move.End.Item1 == row && + move.End.Item2 == column); if (validMove != null) { ClearMoveSelection(redraw: false); From 1a66eb9d230f95b3fdd43a0e7d135017d7c0cfd0 Mon Sep 17 00:00:00 2001 From: binarylab2022-del Date: Tue, 14 Jul 2026 16:12:09 +0100 Subject: [PATCH 2/2] Prepare WinDama 1.0.1-preview release --- Directory.Build.props | 6 +++--- README.md | 2 +- RELEASE_NOTES.md | 20 ++++++++++++++++++++ WinDama1.0/WinDama.csproj | 8 ++++---- scripts/Publish-Release-x64.ps1 | 2 +- 5 files changed, 29 insertions(+), 9 deletions(-) diff --git a/Directory.Build.props b/Directory.Build.props index 3e96d19..e5452b2 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,10 +1,10 @@ - 1.0.0 + 1.0.1 preview $(VersionPrefix)-$(VersionSuffix) - 1.0.0.0 - 1.0.0.0 + 1.0.1.0 + 1.0.1.0 $(Version) WinDama Contributors Touil Gho; WinDama Contributors diff --git a/README.md b/README.md index 9dc6106..84cb3f0 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,7 @@ The self-contained package normally requires no separate .NET installation. ## Current baseline -- Version: `1.0.0-preview` +- Version: `1.0.1-preview` - Engine: `Core engine 2026.07` - Validation: `101 passed, 0 failed` - Framework: `.NET 10.0 Windows / WPF` diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 46f38ea..5567c97 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -1,5 +1,25 @@ # Release Notes +## WinDama 1.0.1-preview +### Platform and build +- Migrated the WPF application to `.NET 10` and `net10.0-windows`. +- Migrated the reusable Core engine and NUnit tests to `net10.0`. +- Added reproducible SDK selection through `global.json`. +- Updated GitHub Actions for .NET 10. +- Updated the Windows x64 publishing workflow. +### Code quality +- Corrected nullable-reference handling in the WPF application. +- Removed the remaining compiler warnings. +- Preserved the existing 101-test regression baseline. +### Documentation +- Reorganized the README into a concise project overview. +- Added architecture, move-generation, AI-search, bitboard, FPGA, and + screenshot documentation. +- Updated requirements for Visual Studio Community 2026. +### Distribution +- Added a new self-contained Windows x64 package. +- A separate .NET installation is normally not required. + ## Platform migration to .NET 10 - Retargeted the reusable Core engine and NUnit tests to `net10.0`. diff --git a/WinDama1.0/WinDama.csproj b/WinDama1.0/WinDama.csproj index f434ce7..e50762b 100644 --- a/WinDama1.0/WinDama.csproj +++ b/WinDama1.0/WinDama.csproj @@ -9,10 +9,10 @@ Resources\256.ico - 1.0.0-preview - 1.0.0.0 - 1.0.0.0 - 1.0.0-preview + 1.0.1-preview + 1.0.1.0 + 1.0.1.0 + 1.0.1-preview WinDama diff --git a/scripts/Publish-Release-x64.ps1 b/scripts/Publish-Release-x64.ps1 index a6eb1fe..9abada0 100644 --- a/scripts/Publish-Release-x64.ps1 +++ b/scripts/Publish-Release-x64.ps1 @@ -10,7 +10,7 @@ $Project = Join-Path $RepoRoot "WinDama1.0\WinDama.csproj" $TestProject = Join-Path $RepoRoot "WinDama.Tests\WinDama.Tests.csproj" $PublishDir = Join-Path $RepoRoot "artifacts\publish\WinDama-win-x64" $PackageDir = Join-Path $RepoRoot "artifacts\packages" -$PackagePath = Join-Path $PackageDir "WinDama-1.0.0-preview-win-x64.zip" +$PackagePath = Join-Path $PackageDir "WinDama-1.0.1-preview-win-x64.zip" Write-Host "WinDama Release x64 publish" -ForegroundColor Cyan Write-Host "Repository: $RepoRoot"