Refactor command to make is shorter
Compare changes
Some changes are not shown
For a faster browsing experience, some files are collapsed by default.
Files
4+ 224
− 399
Files with large changes are collapsed by default.
I noticed that most functions of commands
had a similar shape, so I made it more compact by making calls to the same function for all the commands, with different parameters
I think that the first two changes should be kept as it's pretty clear was it is done and it organizes the code better. For the macro part, while it indeed shortens the code, macros are generally a bit harder to read and maintain, so we may want to keep code very similar between functions.
The reason for using a macro is that the number of arguments for each variant of DragoonCommand is not always the same, so factorizing means writing a function with a variable number of parameters (thus the macro).
I think it would be interesting to run this first after building it, to check that everything works as intended (since we don't have tests yet).
For a faster browsing experience, some files are collapsed by default.
Files with large changes are collapsed by default.