Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup field decoders #6

Open
absolutedogy opened this issue Sep 9, 2024 · 0 comments
Open

Cleanup field decoders #6

absolutedogy opened this issue Sep 9, 2024 · 0 comments

Comments

@absolutedogy
Copy link
Contributor

Since the field decoders were arrived at through a few iterations, there are still remnants of older methodology in the code base, and this can be cleaned up to simplify the decoders.

An example would be the "SetValue" method, which was when the decoders were treated as their own virtual objects that would be containing the value that they decoded as part of the process.

However, decoders really should just be simple readers that take in a BitBuffer and spit out an object value based on how they are configured to read it.

Along with this, when generating them from the field definition, we should only need to return decoders that are logically unique, for example a CHandleDecoder is really just a UInt32 decoder, so during the serializer retrieval we should simplify the list of available decoders so that these special cases just return the decoder that is actually needed instead of a whole new class.

As well the names of the functions can be updated so that they are describing the actual intent of the class.

This renaming can be applied to the decoders themselves as well,
for example DUint32 should be renamed UInt32Decoder

Some nesting can be done as well like using float decoders in the QAngle decoder but that is subjective of if it actually matters or not (floats are just annoying to handle in general)

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

No branches or pull requests

1 participant