Skip to content

feat: refactor union types#8

Merged
volodymyr-fed merged 1 commit intomasterfrom
feature/refactor-unions
May 31, 2025
Merged

feat: refactor union types#8
volodymyr-fed merged 1 commit intomasterfrom
feature/refactor-unions

Conversation

@volodymyr-fed
Copy link
Owner

No description provided.

@volodymyr-fed volodymyr-fed requested a review from Copilot May 31, 2025 09:25
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Refactors how union packets and event details are represented and accessed, migrating to a TryGet API, while updating multi-targeting, tests, and benchmarks.

  • Replace public packet properties with private fields, constructors, and TryGet* methods in UnionPacket and EventDetails.
  • Update README examples, project files, tests, and benchmarks to reflect the new API and add net9.0 support.
  • Simplify IByteWritable.WriteBytes implementations and configure tests to include internal fields.

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
README.md Updated usage examples to the TryGet<PacketName> pattern
F1Game.UDP/Packets/UnionPacket.cs Refactored UnionPacket to use private fields, constructors, TryGet methods, and updated byte writing
F1Game.UDP/Packets/EventDataPacket.cs Simplified WriteBytes to delegate to EventDetails
F1Game.UDP/Events/EventDetails.cs Implemented IByteWritable, added constructors, TryGet* methods, and streamlined implicit operators
F1Game.UDP/F1Game.UDP.csproj Added net9.0 to <TargetFrameworks>
F1Game.UDP.Tests/PacketReaderFixture.cs Configured equivalency to include internal fields
F1Game.UDP.Tests/F1Game.UDP.Tests.csproj Added net9.0 to test project <TargetFrameworks>
F1Game.UDP.Benchamrks/ThirdPartyComparisonBenchmark.cs Switched to TryGet* in benchmarks and added NET9 job
F1Game.UDP.Benchamrks/Program.cs Added NET9 benchmark job
F1Game.UDP.Benchamrks/F1Game.UDP.Benchmarks.csproj Added net9.0 multi-targeting and LangVersion
.editorconfig Added csharp_prefer_system_threading_lock rule and tab indent style
Comments suppressed due to low confidence (1)

F1Game.UDP.Benchamrks/ThirdPartyComparisonBenchmark.cs:1

  • The folder and project name Benchamrks appears to be misspelled; consider renaming it to Benchmarks for consistency.
F1Game.UDP.Benchamrks

@volodymyr-fed volodymyr-fed force-pushed the feature/refactor-unions branch from 4d6b2a7 to 1bf53fd Compare May 31, 2025 09:32
@volodymyr-fed volodymyr-fed merged commit fd7b45a into master May 31, 2025
1 check passed
@volodymyr-fed volodymyr-fed deleted the feature/refactor-unions branch May 31, 2025 09:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants