Skip to content

Commit 3517ff8

Browse files
authored
Merge pull request #93 from NosCoreIO/claude/upgrade-dotnet-10-01YB9kX7SBWLVwrbKw1jju45
Upgrade Project to .NET 10
2 parents 51e46c0 + 73b0014 commit 3517ff8

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+529
-42
lines changed

.github/workflows/dotnet.yml

Lines changed: 14 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -12,25 +12,25 @@ jobs:
1212
build:
1313
runs-on: ubuntu-latest
1414
steps:
15-
- uses: actions/checkout@v2
15+
- uses: actions/checkout@v4
1616
- name: Setup .NET
17-
uses: actions/setup-dotnet@v3
17+
uses: actions/setup-dotnet@v4
1818
with:
19-
dotnet-version: 7.0.x
20-
19+
dotnet-version: 10.0.x
20+
2121
- name: Check Tag
2222
id: check-tag
2323
run: |
2424
if [[ v${{ github.event.ref }} =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
25-
echo ::set-output name=match::true
25+
echo "match=true" >> $GITHUB_OUTPUT
2626
fi
27-
27+
2828
- name: Run Unit Tests
2929
run: |
3030
dotnet restore
3131
dotnet build
3232
dotnet test test/NosCore.Algorithm.Tests -v m
33-
33+
3434
- name: Build Artifact
3535
if: steps.check-tag.outputs.match == 'true'
3636
id: build_artifact
@@ -39,24 +39,13 @@ jobs:
3939
dotnet build -c Release
4040
dotnet pack -c Release -o /tmp/nupkgs -v m -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg
4141
dotnet nuget push /tmp/nupkgs/NosCore.Algorithm.${{github.event.ref}}.nupkg -s https://api.nuget.org/v3/index.json -k ${{secrets.NUGET_API_KEY}}
42-
echo ::set-output name=ARTIFACT_PATH::/tmp/nupkgs/NosCore.Algorithm.${{github.event.ref}}.nupkg
43-
echo ::set-output name=ARTIFACT_NAME::NosCore.Algorithm.${{github.event.ref}}.nupkg
44-
45-
- name: Gets Latest Release
46-
if: steps.check-tag.outputs.match == 'true'
47-
id: latest_release_info
48-
uses: jossef/action-latest-release-info@v1.1.0
49-
env:
50-
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }}
51-
42+
echo "ARTIFACT_PATH=/tmp/nupkgs/NosCore.Algorithm.${{github.event.ref}}.nupkg" >> $GITHUB_OUTPUT
43+
echo "ARTIFACT_NAME=NosCore.Algorithm.${{github.event.ref}}.nupkg" >> $GITHUB_OUTPUT
44+
5245
- name: Upload Release Asset
5346
if: steps.check-tag.outputs.match == 'true'
54-
uses: actions/upload-release-asset@v1
5547
env:
56-
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }}
57-
with:
58-
upload_url: ${{ steps.latest_release_info.outputs.upload_url }}
59-
asset_path: ${{ steps.build_artifact.outputs.ARTIFACT_PATH }}
60-
asset_name: ${{ steps.build_artifact.outputs.ARTIFACT_NAME }}
61-
asset_content_type: application/zip
62-
48+
GH_TOKEN: ${{ secrets.REPO_TOKEN }}
49+
run: |
50+
gh release upload ${{ github.event.ref }} ${{ steps.build_artifact.outputs.ARTIFACT_PATH }}
51+

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,4 +500,5 @@ fabric.properties
500500
/build/net*.*
501501
/documentation/*.received.md
502502
/documentation/*.received.txt
503-
/documentation/*.approved.txt
503+
/documentation/*.approved.txt
504+
build_output.txt

src/NosCore.Algorithm/CloseDefenceService/CloseDefenceService.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,16 @@
22

33
namespace NosCore.Algorithm.CloseDefenceService
44
{
5+
/// <summary>
6+
/// Provides close combat defence value calculations for different character classes and levels
7+
/// </summary>
58
public class CloseDefenceService : ICloseDefenceService
69
{
710
private readonly long[,] _closeDefence = new long[Constants.ClassCount, Constants.MaxLevel];
811

12+
/// <summary>
13+
/// Initializes a new instance of the CloseDefenceService and pre-calculates close defence values for all character classes and levels
14+
/// </summary>
915
public CloseDefenceService()
1016
{
1117
var adventurerDefence = 4;
@@ -34,6 +40,12 @@ public CloseDefenceService()
3440
}
3541
}
3642

43+
/// <summary>
44+
/// Gets the close defence value for a character class at a specific level
45+
/// </summary>
46+
/// <param name="class">The character class type</param>
47+
/// <param name="level">The character level</param>
48+
/// <returns>The close defence value</returns>
3749
public long GetCloseDefence(CharacterClassType @class, byte level)
3850
{
3951
return _closeDefence![(byte)@class, level - 1];

src/NosCore.Algorithm/CloseDefenceService/ICloseDefenceService.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,17 @@
55

66
namespace NosCore.Algorithm.CloseDefenceService
77
{
8+
/// <summary>
9+
/// Service for calculating close combat defence values
10+
/// </summary>
811
public interface ICloseDefenceService
912
{
13+
/// <summary>
14+
/// Gets the close defence value for a character class at a specific level
15+
/// </summary>
16+
/// <param name="entityClass">The character class type</param>
17+
/// <param name="level">The character level</param>
18+
/// <returns>The close defence value</returns>
1019
long GetCloseDefence(CharacterClassType entityClass, byte level);
1120
}
1221
}

src/NosCore.Algorithm/DamageService/DamageService.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,16 @@
88

99
namespace NosCore.Algorithm.DamageService
1010
{
11+
/// <summary>
12+
/// Provides damage value calculations for different character classes and levels
13+
/// </summary>
1114
public class DamageService : IDamageService
1215
{
1316
private readonly long[,] _minDamage = new long[Constants.ClassCount, Constants.MaxLevel];
1417

18+
/// <summary>
19+
/// Initializes a new instance of the DamageService and pre-calculates damage values for all character classes and levels
20+
/// </summary>
1521
public DamageService()
1622
{
1723
_minDamage[(byte)CharacterClassType.Adventurer, 0] = 10;
@@ -76,11 +82,23 @@ public DamageService()
7682
}
7783
}
7884

85+
/// <summary>
86+
/// Gets the minimum damage value for a character class at a specific level
87+
/// </summary>
88+
/// <param name="class">The character class type</param>
89+
/// <param name="level">The character level</param>
90+
/// <returns>The minimum damage value</returns>
7991
public long GetMinDamage(CharacterClassType @class, byte level)
8092
{
8193
return _minDamage![(byte)@class, level - 1];
8294
}
8395

96+
/// <summary>
97+
/// Gets the maximum damage value for a character class at a specific level
98+
/// </summary>
99+
/// <param name="class">The character class type</param>
100+
/// <param name="level">The character level</param>
101+
/// <returns>The maximum damage value</returns>
84102
public long GetMaxDamage(CharacterClassType @class, byte level) => GetMinDamage(@class, level);
85103
}
86104
}

src/NosCore.Algorithm/DamageService/IDamageService.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,25 @@
88

99
namespace NosCore.Algorithm.DamageService
1010
{
11+
/// <summary>
12+
/// Service for calculating damage values for different character classes
13+
/// </summary>
1114
public interface IDamageService
1215
{
16+
/// <summary>
17+
/// Gets the minimum damage value for a character class at a specific level
18+
/// </summary>
19+
/// <param name="entityClass">The character class type</param>
20+
/// <param name="level">The character level</param>
21+
/// <returns>The minimum damage value</returns>
1322
long GetMinDamage(CharacterClassType entityClass, byte level);
1423

24+
/// <summary>
25+
/// Gets the maximum damage value for a character class at a specific level
26+
/// </summary>
27+
/// <param name="entityClass">The character class type</param>
28+
/// <param name="level">The character level</param>
29+
/// <returns>The maximum damage value</returns>
1530
long GetMaxDamage(CharacterClassType entityClass, byte level);
1631
}
1732
}

src/NosCore.Algorithm/DignityService/DignityService.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,16 @@
1111

1212
namespace NosCore.Algorithm.DignityService
1313
{
14+
/// <summary>
15+
/// Provides dignity level and threshold calculations
16+
/// </summary>
1417
public class DignityService : IDignityService
1518
{
1619
private readonly Dictionary<DignityType, short> _dignityData = new Dictionary<DignityType, short>();
1720

21+
/// <summary>
22+
/// Initializes a new instance of the DignityService and sets up dignity thresholds for each dignity type
23+
/// </summary>
1824
public DignityService()
1925
{
2026
_dignityData[DignityType.Default] = -99;
@@ -25,6 +31,11 @@ public DignityService()
2531
_dignityData[DignityType.Failed] = -1000;
2632
}
2733

34+
/// <summary>
35+
/// Gets the dignity level type based on a dignity value
36+
/// </summary>
37+
/// <param name="dignity">The dignity value</param>
38+
/// <returns>The dignity level type</returns>
2839
public DignityType GetLevelFromDignity(short dignity)
2940
{
3041
foreach (var reput in Enum.GetValues(typeof(DignityType)).Cast<DignityType>())
@@ -38,6 +49,11 @@ public DignityType GetLevelFromDignity(short dignity)
3849
return DignityType.Failed;
3950
}
4051

52+
/// <summary>
53+
/// Gets the dignity value range for a specific dignity level
54+
/// </summary>
55+
/// <param name="level">The dignity level type</param>
56+
/// <returns>A tuple containing the maximum and minimum dignity values for the level</returns>
4157
public (short, short) GetDignity(DignityType level)
4258
{
4359
return (level == DignityType.Default ? (short)200 : (short)(_dignityData[level - 1] - 1), _dignityData[level]);

src/NosCore.Algorithm/DignityService/IDignityService.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,23 @@
88

99
namespace NosCore.Algorithm.DignityService
1010
{
11+
/// <summary>
12+
/// Service for calculating dignity levels and thresholds
13+
/// </summary>
1114
public interface IDignityService
1215
{
16+
/// <summary>
17+
/// Gets the dignity level type based on a dignity value
18+
/// </summary>
19+
/// <param name="dignity">The dignity value</param>
20+
/// <returns>The dignity level type</returns>
1321
DignityType GetLevelFromDignity(short dignity);
22+
23+
/// <summary>
24+
/// Gets the dignity value range for a specific dignity level
25+
/// </summary>
26+
/// <param name="level">The dignity level type</param>
27+
/// <returns>A tuple containing the maximum and minimum dignity values for the level</returns>
1428
(short, short) GetDignity(DignityType level);
1529
}
1630
}

src/NosCore.Algorithm/DistanceDefenceService/DistanceDefenceService.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,16 @@
22

33
namespace NosCore.Algorithm.DistanceDefenceService
44
{
5+
/// <summary>
6+
/// Provides distance combat defence value calculations for different character classes and levels
7+
/// </summary>
58
public class DistanceDefenceService : IDistanceDefenceService
69
{
710
private readonly long[,] _distanceDefence = new long[Constants.ClassCount, Constants.MaxLevel];
811

12+
/// <summary>
13+
/// Initializes a new instance of the DistanceDefenceService and pre-calculates distance defence values for all character classes and levels
14+
/// </summary>
915
public DistanceDefenceService()
1016
{
1117
var adventurerDefence = 4;
@@ -32,6 +38,12 @@ public DistanceDefenceService()
3238
}
3339
}
3440

41+
/// <summary>
42+
/// Gets the distance defence value for a character class at a specific level
43+
/// </summary>
44+
/// <param name="class">The character class type</param>
45+
/// <param name="level">The character level</param>
46+
/// <returns>The distance defence value</returns>
3547
public long GetDistanceDefence(CharacterClassType @class, byte level)
3648
{
3749
return _distanceDefence![(byte)@class, level - 1];

src/NosCore.Algorithm/DistanceDefenceService/IDistanceDefenceService.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,17 @@
55

66
namespace NosCore.Algorithm.DistanceDefenceService
77
{
8+
/// <summary>
9+
/// Service for calculating distance combat defence values
10+
/// </summary>
811
public interface IDistanceDefenceService
912
{
13+
/// <summary>
14+
/// Gets the distance defence value for a character class at a specific level
15+
/// </summary>
16+
/// <param name="entityClass">The character class type</param>
17+
/// <param name="level">The character level</param>
18+
/// <returns>The distance defence value</returns>
1019
long GetDistanceDefence(CharacterClassType entityClass, byte level);
1120
}
1221
}

0 commit comments

Comments
 (0)