From 69e71ee3f0fdf58bbecb5778d9aa57735cb3f108 Mon Sep 17 00:00:00 2001 From: chijason99 Date: Tue, 18 Feb 2025 06:01:01 +0000 Subject: [PATCH] fix: di not working --- README.md | 4 ++++ XiangqiCore/Extension/DependencyInjection.cs | 3 --- XiangqiCore/Game/XiangqiBuilder.cs | 5 +++++ XiangqiCore/XiangqiCore.csproj | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 5f62afa..c6282df 100644 --- a/README.md +++ b/README.md @@ -1202,6 +1202,10 @@ string translatedMove = moveTranslationService.TranslateMove(game.MoveHistory[0] ## Release Notes +Version 2.1.0 +- Fix the issue where the `AddXiangqiCore` extension method throws an error +- Improve the memory performance when validating the moves + Version 2.0.1 Bug Fixes: diff --git a/XiangqiCore/Extension/DependencyInjection.cs b/XiangqiCore/Extension/DependencyInjection.cs index c0f3584..bf8573b 100644 --- a/XiangqiCore/Extension/DependencyInjection.cs +++ b/XiangqiCore/Extension/DependencyInjection.cs @@ -25,9 +25,6 @@ public static IServiceCollection AddXiangqiCore(this IServiceCollection services services.AddScoped(); services.AddScoped(); - services.AddScoped(); - services.AddScoped(); - services.AddScoped(); return services; diff --git a/XiangqiCore/Game/XiangqiBuilder.cs b/XiangqiCore/Game/XiangqiBuilder.cs index 12ea323..4177ec1 100644 --- a/XiangqiCore/Game/XiangqiBuilder.cs +++ b/XiangqiCore/Game/XiangqiBuilder.cs @@ -42,6 +42,11 @@ public XiangqiBuilder() { } + public XiangqiBuilder(IMoveParsingService moveParsingService) + { + _moveParsingService = moveParsingService; + } + /// /// Sets the Xiangqi game configuration to the default starting position. /// diff --git a/XiangqiCore/XiangqiCore.csproj b/XiangqiCore/XiangqiCore.csproj index f066505..7493817 100644 --- a/XiangqiCore/XiangqiCore.csproj +++ b/XiangqiCore/XiangqiCore.csproj @@ -16,7 +16,7 @@ README.md https://github.com/chijason99/Xiangqi-Core xiangqi;chinese chess - 2.0.1 + 2.1.0