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
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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'
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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)

Expand Down Expand Up @@ -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
Expand Down
52 changes: 26 additions & 26 deletions WinDama1.0/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
private int? selectedColumn = null;
private int? selectedRow = null;
private readonly List<Move> highlightedLegalMoves = new List<Move>();
private Move lastMove = null;
private Move? lastMove;
private const int AiTieBreakTolerance = 0;
private const int BoardSquareSize = 80;
private const int BoardOffset = 30;
Expand Down Expand Up @@ -142,37 +142,37 @@

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;
}

//-----------------------------------------------------------------------
Expand Down Expand Up @@ -450,7 +450,7 @@
//-----------------------------------------------------------------------
public void DrawBoard(Canvas canvas, int[,] board)
{
boardRenderer.Draw(canvas, board, pieceSelected, selectedRow, selectedColumn, highlightedLegalMoves, lastMove);

Check warning on line 453 in WinDama1.0/MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / Build WinDama

Possible null reference argument for parameter 'lastMove' in 'void BoardRenderer.Draw(Canvas canvas, int[,] board, bool pieceSelected, int? selectedRow, int? selectedColumn, IReadOnlyList<Move> highlightedLegalMoves, Move lastMove)'.

Check warning on line 453 in WinDama1.0/MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / Build WinDama

Possible null reference argument for parameter 'lastMove' in 'void BoardRenderer.Draw(Canvas canvas, int[,] board, bool pieceSelected, int? selectedRow, int? selectedColumn, IReadOnlyList<Move> highlightedLegalMoves, Move lastMove)'.

Check warning on line 453 in WinDama1.0/MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / Run NUnit tests

Possible null reference argument for parameter 'lastMove' in 'void BoardRenderer.Draw(Canvas canvas, int[,] board, bool pieceSelected, int? selectedRow, int? selectedColumn, IReadOnlyList<Move> highlightedLegalMoves, Move lastMove)'.

Check warning on line 453 in WinDama1.0/MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / Run NUnit tests

Possible null reference argument for parameter 'lastMove' in 'void BoardRenderer.Draw(Canvas canvas, int[,] board, bool pieceSelected, int? selectedRow, int? selectedColumn, IReadOnlyList<Move> highlightedLegalMoves, Move lastMove)'.
}

//-----------------------------------------------------------------------
Expand Down Expand Up @@ -484,7 +484,7 @@
MinimaxDepth = newDepth;
// Apply any necessary logic based on the updated depth
}

//-----------------------------------------------------------------------
private void ChessBoardGrid_MouseDown(object sender, MouseButtonEventArgs e)
{
Expand Down Expand Up @@ -1078,7 +1078,7 @@
return;
}

string summary = result == null

Check warning on line 1081 in WinDama1.0/MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / Build WinDama

Converting null literal or possible null value to non-nullable type.

Check warning on line 1081 in WinDama1.0/MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / Run NUnit tests

Converting null literal or possible null value to non-nullable type.
? string.Empty
: analysisPanelUpdater?.UpdateFromResult(result, GetSearchModeLabel(result.Mode));

Expand All @@ -1101,7 +1101,7 @@
return;
}

string summary = analysisPanelUpdater?.UpdateFromProgress(progress, GetSearchModeLabel(selectedAiSearchMode));

Check warning on line 1104 in WinDama1.0/MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / Build WinDama

Converting null literal or possible null value to non-nullable type.

Check warning on line 1104 in WinDama1.0/MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / Run NUnit tests

Converting null literal or possible null value to non-nullable type.
if (!string.IsNullOrWhiteSpace(summary))
{
SetAnalysisSummary(summary);
Expand Down Expand Up @@ -1141,7 +1141,7 @@




//-----------------------------------------------------------------------
private void ResetGame()
{
Expand Down Expand Up @@ -1256,7 +1256,7 @@
try
{
Directory.CreateDirectory(DefaultTestPositionsFolder);
string suggestedName = BoardEditorController.BuildSafePositionFileName(PositionNameTextBox?.Text);

Check warning on line 1259 in WinDama1.0/MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / Build WinDama

Possible null reference argument for parameter 'text' in 'string BoardEditorController.BuildSafePositionFileName(string text)'.

Check warning on line 1259 in WinDama1.0/MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / Run NUnit tests

Possible null reference argument for parameter 'text' in 'string BoardEditorController.BuildSafePositionFileName(string text)'.
SaveFileDialog dialog = new SaveFileDialog
{
Title = "Save WinDama test position",
Expand Down Expand Up @@ -1383,7 +1383,7 @@
CancelBackgroundPositionAnalysis();
ClearMoveSelection(redraw: false);

Move lastMoveForState = resetLastMove ? null : lastMove;

Check warning on line 1386 in WinDama1.0/MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / Build WinDama

Converting null literal or possible null value to non-nullable type.

Check warning on line 1386 in WinDama1.0/MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / Run NUnit tests

Converting null literal or possible null value to non-nullable type.
gameController.SetGameMode(selectedGameMode);
gameController.RestoreState(board, currentPlayer, isGameOver: false, lastMove: lastMoveForState);
SynchronizeFieldsFromGameController();
Expand Down Expand Up @@ -1499,7 +1499,7 @@
{
if (!Dispatcher.CheckAccess())
{
Dispatcher.BeginInvoke(new Action(() => StartBackgroundPositionAnalysis(reason)));

Check warning on line 1502 in WinDama1.0/MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / Build WinDama

Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call.

Check warning on line 1502 in WinDama1.0/MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / Run NUnit tests

Because this call is not awaited, execution of the current method continues before the call is completed. Consider applying the 'await' operator to the result of the call.
return;
}

Expand Down Expand Up @@ -3331,7 +3331,7 @@
}

//-----------------------------------------------------------------------
private Move CloneMove(Move move)
private Move? CloneMove(Move? move)
{
if (move == null)
{
Expand Down Expand Up @@ -3394,7 +3394,7 @@
// 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);

Check warning on line 3397 in WinDama1.0/MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / Build WinDama

Converting null literal or possible null value to non-nullable type.

Check warning on line 3397 in WinDama1.0/MainWindow.xaml.cs

View workflow job for this annotation

GitHub Actions / Run NUnit tests

Converting null literal or possible null value to non-nullable type.
if (validMove != null)
{
ClearMoveSelection(redraw: false);
Expand Down
6 changes: 6 additions & 0 deletions global.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"sdk": {
"rollForward": "latestFeature",
"version": "10.0.301"
}
}
Loading