Open kiairatech opened 4 years ago
I like the fact that the opcode size and codec can be found in the same file, enum separates the two but does give a centralized place to find the information. No real benefits just different based on opinion.
The other similar ways would be to make the parent file abstract and pass the values in the constructor. OR have abstract values that need overriding (verbose).
Probably not worth wasting time over small issues like this which would take a notable amount of time to migrate but don't really provide any tangible benefit other than clarity
Enum can be used to simplify encoding/decoding. Removes the requirement of packet id and type definition from the decoder. Used for encoding as well.