Skip to content

Cleanup field decoders #6

@absolutedogy

Description

@absolutedogy

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions