chore: client/tools standards nits — dedup, splits, idioms (#51) #125

Merged
marco merged 1 commit from chore/client-standards-nits into main 2026-07-22 06:25:32 +02:00
Owner

Summary

Client/tools standards micro-nits from #51 — the mechanical, low-risk subset:

  • Dedup: the ARGB1555→RGBA ToRgba (copied verbatim in AnimMulReader/ArtMulReader/GumpMulReader) → one UoColor.ToRgba; the System.Numerics→XNA Vector2 bridge (hand-written ~6× across Player/Mobile/Corpse/GridRenderer/WorldRenderer/ScreenProjection) → one NumericsExtensions.ToXna.
  • One-type-per-file: split AssetPack.cs's public records into FrameData.cs / AnimationData.cs; moved HumanArtSet to its own file and renamed it AnimationSet (it's reused for creatures/corpses/effects, not just the human).
  • Idioms: primary constructors for AssetPack, WebSocketConnection, JwtTokenService; a StartsWith("--") gains StringComparison.Ordinal.

Deferred (kept on a re-scoped #51): the ClientConfig/Session single-source item — it touches session wiring (AccessToken/URLs) across login/game/connection and deserves its own careful pass, not a drive-by. The "redundant usings in AssetEditor" item was already clean (unused usings are build errors here, and the build is green).

Screenshots / recording

No visible change (refactor only).

How it was tested

dotnet test green (331); whole solution builds 0 warnings; just lint clean. No behavioural change — pure dedup / file-split / idiom.

Checklist

  • just lint passes (CSharpier + analyzers, zero warnings)
  • just test is green
  • The whole solution builds (client and tools included)
  • Multi-platform preserved
  • Tests added/updated for this change (n/a — no behaviour change; covered by existing tests)
  • Linked the related issue (#51 — partial; Session single-source deferred)
## Summary Client/tools standards micro-nits from #51 — the mechanical, low-risk subset: - **Dedup**: the ARGB1555→RGBA `ToRgba` (copied verbatim in `AnimMulReader`/`ArtMulReader`/`GumpMulReader`) → one `UoColor.ToRgba`; the `System.Numerics`→XNA `Vector2` bridge (hand-written ~6× across `Player`/`Mobile`/`Corpse`/`GridRenderer`/`WorldRenderer`/`ScreenProjection`) → one `NumericsExtensions.ToXna`. - **One-type-per-file**: split `AssetPack.cs`'s public records into `FrameData.cs` / `AnimationData.cs`; moved `HumanArtSet` to its own file and renamed it **`AnimationSet`** (it's reused for creatures/corpses/effects, not just the human). - **Idioms**: primary constructors for `AssetPack`, `WebSocketConnection`, `JwtTokenService`; a `StartsWith("--")` gains `StringComparison.Ordinal`. **Deferred (kept on a re-scoped #51):** the `ClientConfig`/`Session` single-source item — it touches session wiring (`AccessToken`/URLs) across login/game/connection and deserves its own careful pass, not a drive-by. The "redundant usings in AssetEditor" item was already clean (unused usings are build errors here, and the build is green). ## Screenshots / recording _No visible change (refactor only)._ ## How it was tested `dotnet test` green (331); whole solution builds 0 warnings; `just lint` clean. No behavioural change — pure dedup / file-split / idiom. ## Checklist - [x] `just lint` passes (CSharpier + analyzers, zero warnings) - [x] `just test` is green - [x] The whole solution builds (client and tools included) - [x] Multi-platform preserved - [x] Tests added/updated for this change (n/a — no behaviour change; covered by existing tests) - [x] Linked the related issue (#51 — partial; Session single-source deferred)
chore: client/tools standards nits — dedup, splits, idioms (#51)
All checks were successful
ci / Lint & Test (pull_request) Successful in 1m35s
077c25198f
- Dedup: ARGB1555->RGBA `ToRgba` (was copied in Anim/Art/Gump mul readers) -> one
  `UoColor.ToRgba`; the System.Numerics->XNA Vector2 bridge (copied ~6x across
  Player/Mobile/Corpse/GridRenderer/WorldRenderer/ScreenProjection) -> one
  `NumericsExtensions.ToXna`.
- One-type-per-file: split `AssetPack.cs` public records into `FrameData.cs` /
  `AnimationData.cs`; moved `HumanArtSet` to its own file and renamed it `AnimationSet`
  (it's reused for creatures/corpses/effects, not just the human).
- Idioms: primary ctors for `AssetPack`, `WebSocketConnection`, `JwtTokenService`;
  `StartsWith("--")` -> `StartsWith("--", StringComparison.Ordinal)`.

Deferred: the ClientConfig/Session single-source item (touches session wiring across
the client) — left on a re-scoped #51. (AssetEditor 'redundant usings' item was
already clean — the analyzer would fail the build otherwise.)
marco merged commit 6969748dfa into main 2026-07-22 06:25:32 +02:00
marco deleted branch chore/client-standards-nits 2026-07-22 06:25:32 +02:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
marco/IsoMmo!125
No description provided.