diff --git a/.cursor/rules/csharp-style.md b/.cursor/rules/csharp-style.md index 641404f..adf9152 100644 --- a/.cursor/rules/csharp-style.md +++ b/.cursor/rules/csharp-style.md @@ -133,7 +133,7 @@ var store = secondScope.ServiceProvider.GetRequiredService(); // ## Documentation - Use **`///` XML doc comments** on public APIs (types and members) when behavior or contracts are not obvious. -- **Primary-constructor records:** include a **``** plus **``** for every constructor parameter (Roslynator RCS1139 / RCS1263). Do not leave orphaned `` lines without a summary on the type. +- **Primary-constructor records:** include a **``** on the type. Prefer **``** in the summary for positional parameters. Do **not** use **``** on **`record struct`** primary constructors — Roslynator reports false-positive **RCS1263** ([roslynator#1730](https://github.com/dotnet/roslynator/issues/1730)). **`record class`** / **`class`** primary constructors may use `` when the analyzer accepts them. ## Null checks (IDE0270) diff --git a/server/NeonSprawl.Server.Tests/Game/Rewards/RewardRouterOperationsTests.cs b/server/NeonSprawl.Server.Tests/Game/Rewards/RewardRouterOperationsTests.cs index fa40ef2..673f377 100644 --- a/server/NeonSprawl.Server.Tests/Game/Rewards/RewardRouterOperationsTests.cs +++ b/server/NeonSprawl.Server.Tests/Game/Rewards/RewardRouterOperationsTests.cs @@ -803,7 +803,7 @@ public sealed class RewardRouterOperationsTests var filtered = rows.Where(r => r.PlayerId == normalized).ToList(); if (limit is > 0) { - return filtered.Take(limit.Value).ToList(); + return [.. filtered.Take(limit.Value)]; } return filtered; diff --git a/server/NeonSprawl.Server/Game/Gathering/ResourceNodeInstanceMutationOutcome.cs b/server/NeonSprawl.Server/Game/Gathering/ResourceNodeInstanceMutationOutcome.cs index 351025b..2b714aa 100644 --- a/server/NeonSprawl.Server/Game/Gathering/ResourceNodeInstanceMutationOutcome.cs +++ b/server/NeonSprawl.Server/Game/Gathering/ResourceNodeInstanceMutationOutcome.cs @@ -10,10 +10,11 @@ public enum ResourceNodeInstanceMutationKind Applied, } -/// Result of (NEO-61). -/// Applied or denied. -/// Populated when is . -/// Authoritative snapshot after apply, or current snapshot on depletion deny; null for unknown node. +/// +/// Result of (NEO-61). +/// is populated when is . +/// is the authoritative snapshot after apply, or the current snapshot on depletion deny; null for unknown node. +/// public readonly record struct ResourceNodeInstanceMutationOutcome( ResourceNodeInstanceMutationKind Kind, string? ReasonCode, diff --git a/server/NeonSprawl.Server/Game/Items/PlayerInventoryMutationOutcome.cs b/server/NeonSprawl.Server/Game/Items/PlayerInventoryMutationOutcome.cs index 645bdc2..a224a5d 100644 --- a/server/NeonSprawl.Server/Game/Items/PlayerInventoryMutationOutcome.cs +++ b/server/NeonSprawl.Server/Game/Items/PlayerInventoryMutationOutcome.cs @@ -13,10 +13,11 @@ public enum PlayerInventoryMutationKind Applied, } -/// Result of or (NEO-54). -/// Applied, denied, or store missing. -/// Populated when is . -/// Authoritative snapshot after apply, or unchanged snapshot on deny; null when store missing. +/// +/// Result of or (NEO-54). +/// is populated when is . +/// is the authoritative snapshot after apply, or unchanged snapshot on deny; null when store missing. +/// public readonly record struct PlayerInventoryMutationOutcome( PlayerInventoryMutationKind Kind, string? ReasonCode,