diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index d9a4aa9..4d01ebe 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,7 +19,7 @@ jobs: steps: - name: Checkout source - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Set up .NET 10 uses: actions/setup-dotnet@v5 diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 3d94482..3033e55 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -19,7 +19,7 @@ jobs: steps: - name: Checkout source - uses: actions/checkout@v4 + uses: actions/checkout@v5 - name: Set up .NET 10 uses: actions/setup-dotnet@v5 @@ -45,7 +45,7 @@ jobs: - name: Upload test results if: always() - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@v6 with: name: WinDama-test-results path: '**/WinDamaTests.trx' diff --git a/README.md b/README.md index 736e2f3..9dc6106 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# WinDama ├تظéشظ€إ Algerian / Spanish Checkers +# WinDama ├تظéشظ€إ Algerian / Spanish Checkers [![Build](https://github.com/binarylab2022-del/WinDama/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/binarylab2022-del/WinDama/actions/workflows/build.yml) [![Tests](https://github.com/binarylab2022-del/WinDama/actions/workflows/tests.yml/badge.svg?branch=main)](https://github.com/binarylab2022-del/WinDama/actions/workflows/tests.yml) ![Test baseline](https://img.shields.io/badge/tests-101%20passed-brightgreen) [![Release](https://img.shields.io/github/v/release/binarylab2022-del/WinDama?include_prereleases)](https://github.com/binarylab2022-del/WinDama/releases) [![License](https://img.shields.io/github/license/binarylab2022-del/WinDama)](LICENSE) ![Platform](https://img.shields.io/badge/platform-Windows%20x64-blue) ![Framework](https://img.shields.io/badge/.NET-10.0-purple) @@ -121,7 +121,7 @@ scripts/ Build and release scripts ## Build and test -Requirements: Visual Studio 2022 with the .NET desktop workload and .NET 10 SDK. +Requirements: Visual Studio Community 2026 with the .NET desktop development workload, or the .NET 10 SDK for command-line builds. ```powershell dotnet restore WinDama.sln diff --git a/WinDama1.0/MainWindow.xaml.cs b/WinDama1.0/MainWindow.xaml.cs index 7b29b54..9b23021 100644 --- a/WinDama1.0/MainWindow.xaml.cs +++ b/WinDama1.0/MainWindow.xaml.cs @@ -39,7 +39,7 @@ public partial class MainWindow : Window private int? selectedColumn = null; private int? selectedRow = null; private readonly List highlightedLegalMoves = new List(); - private Move lastMove = null; + private Move? lastMove; private const int AiTieBreakTolerance = 0; private const int BoardSquareSize = 80; private const int BoardOffset = 30; @@ -142,37 +142,37 @@ private sealed class AppUserSettings private sealed class UiGameSnapshot { - public WinDama.Core.GameSnapshot CoreSnapshot { get; set; } - public int[,] Board { get; set; } + public WinDama.Core.GameSnapshot? CoreSnapshot { get; set; } + public int[,] Board { get; set; } = new int[8, 8]; public int CurrentPlayer { get; set; } - public Move LastMove { get; set; } + public Move? LastMove { get; set; } public TimeSpan Player1TimeRemaining { get; set; } public TimeSpan Player2TimeRemaining { get; set; } public bool IsGameOver { get; set; } public AiSearchMode SelectedAiSearchMode { get; set; } public GameMode SelectedGameMode { get; set; } public int MinimaxDepth { get; set; } - public string AiTimePerMoveText { get; set; } - public string GameClockMinutesText { get; set; } - public string StatusText { get; set; } - public string AnalysisSummaryText { get; set; } - public string SearchModeText { get; set; } - public string SearchDepthText { get; set; } - public string SearchNodesText { get; set; } - public string SearchEvalText { get; set; } - public string SearchBestMoveText { get; set; } - public string SearchTimeText { get; set; } - public string SearchNodesPerSecondText { get; set; } - public string SearchLegalMovesText { get; set; } - public string SearchBudgetText { get; set; } - public string SearchStatusText { get; set; } - public string SearchTranspositionText { get; set; } - public string SearchTopMovesText { get; set; } - public string SearchPrincipalVariationText { get; set; } + public string AiTimePerMoveText { get; set; } = string.Empty; + public string GameClockMinutesText { get; set; } = string.Empty; + public string StatusText { get; set; } = string.Empty; + public string AnalysisSummaryText { get; set; } = string.Empty; + public string SearchModeText { get; set; } = string.Empty; + public string SearchDepthText { get; set; } = string.Empty; + public string SearchNodesText { get; set; } = string.Empty; + public string SearchEvalText { get; set; } = string.Empty; + public string SearchBestMoveText { get; set; } = string.Empty; + public string SearchTimeText { get; set; } = string.Empty; + public string SearchNodesPerSecondText { get; set; } = string.Empty; + public string SearchLegalMovesText { get; set; } = string.Empty; + public string SearchBudgetText { get; set; } = string.Empty; + public string SearchStatusText { get; set; } = string.Empty; + public string SearchTranspositionText { get; set; } = string.Empty; + public string SearchTopMovesText { get; set; } = string.Empty; + public string SearchPrincipalVariationText { get; set; } = string.Empty; public bool IsBoardEditorMode { get; set; } public int EditorSelectedPieceValue { get; set; } - public string PositionNameText { get; set; } - public string PositionNotesText { get; set; } + public string PositionNameText { get; set; } = string.Empty; + public string PositionNotesText { get; set; } = string.Empty; } //----------------------------------------------------------------------- @@ -484,7 +484,7 @@ private void UpdateMinimaxDepth(int newDepth) MinimaxDepth = newDepth; // Apply any necessary logic based on the updated depth } - + //----------------------------------------------------------------------- private void ChessBoardGrid_MouseDown(object sender, MouseButtonEventArgs e) { @@ -1141,7 +1141,7 @@ private string GetSearchModeLabel(WinDama.Core.SearchMode mode) - + //----------------------------------------------------------------------- private void ResetGame() { @@ -3331,7 +3331,7 @@ private bool HandleMoveExecution(Move move, int player) } //----------------------------------------------------------------------- - private Move CloneMove(Move move) + private Move? CloneMove(Move? move) { if (move == null) { diff --git a/global.json b/global.json new file mode 100644 index 0000000..333cca1 --- /dev/null +++ b/global.json @@ -0,0 +1,6 @@ +{ + "sdk": { + "rollForward": "latestFeature", + "version": "10.0.301" + } +}