Codechange: Add HasFlag() to test if a value is present in a bitset enum type. (...
commit376e882a145ae98e355a56d70b3425bbee3b8931
authorPeter Nelson <peter1138@openttd.org>
Sun, 22 Sep 2024 13:51:37 +0000 (22 14:51 +0100)
committerGitHub <noreply@github.com>
Sun, 22 Sep 2024 13:51:37 +0000 (22 14:51 +0100)
treef6a34ac226ed1c7d0b5ebd55fe91b6632f945f41
parentd450d4743eba8b3f6cba8c0f1ca92e836188edba
Codechange: Add HasFlag() to test if a value is present in a bitset enum type. (#12959)

This simplifies tests for `(x & y) != y` with enum classes by reducing repetition, similar to HasBit(), and also makes the intent of the expression clearer.
src/autoreplace_gui.cpp
src/build_vehicle_gui.cpp
src/core/enum_type.hpp
src/engine.cpp
src/station_cmd.cpp
src/vehicle.cpp
src/vehicle_cmd.cpp
src/widget.cpp