Refactor pathfinding_settings constructor arguments #37992
Labels
[C++]
Changes (can be) made in C++. Previously named `Code`
Code: Infrastructure / Style / Static Analysis
Code internal infrastructure and style
<Enhancement / Feature>
New features, or enhancements on existing
Monsters
Monsters both friendly and unfriendly.
stale
Closed for lack of activity, but still valid.
Is your feature request related to a problem? Please describe.
@codemime made a point in #37964 that the pathfinding_settings constructor which currently has 9 int & boolean arguments could be refactored into explicit assignments or a bitset.
Describe the solution you'd like
Above suggestion seems reasonable.
Describe alternatives you've considered
Not doing anything, or taking a pass at fixing this up in multiple places in the codebase (and maybe making an explicit code style recommendation for future cases like this, if it doesn't exist already).
Additional context
My PR moved this method from 8 args to 9 args, so I didn't a strong case for refactoring as part of that PR, but I agree that long primitive methods can be a little error-prone and hard to read.
The text was updated successfully, but these errors were encountered: