Skip to content

Conversation

@mibac138
Copy link

This makes the code clearer, it's more convenient than casting to number-types, and is smaller on the wire (as some enums were needlessly sent as an int).

This makes the code clearer, it's more convenient than casting to
number-types, and is smaller on the wire (as some enums were needlessly
sent as an int).
Copy link
Member

@notfood notfood left a comment

Choose a reason for hiding this comment

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

Looks nice. My only concern is how it affects performance. There may be places you don't want to repeatedly call Enum.GetValues. I suspect ScheduledCommand gets called a lot and it may not need that abstraction.

@mibac138
Copy link
Author

That's a fair point. I've introduce a cache to only call Enum.GetValues once and went back to using {Read,Write}Byte directly in ScheduledCommand

@notfood notfood added the enhancement New feature or request. label Apr 10, 2025
@notfood notfood changed the base branch from master to dev July 1, 2025 16:17
@notfood notfood merged commit 6e36e3a into rwmt:dev Jul 1, 2025
1 check passed
@mibac138 mibac138 deleted the net-enum branch July 2, 2025 01:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants