mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-06 09:09:40 +02:00
CPathfinder: use struct instead of enum for options
Suggested by @DjWarmonger as better alternative from performance standpoint while struct still more organized than bunch of variables. Other reason of change it's that in future we may need non-boolean options, e.g for patrol movement and some new pathfinder usages.
This commit is contained in:
@@ -279,17 +279,19 @@ struct DLL_EXPORT DuelParameters
|
||||
class CPathfinder : private CGameInfoCallback
|
||||
{
|
||||
private:
|
||||
enum class EOptions
|
||||
struct PathfinderOptions
|
||||
{
|
||||
FLYING,
|
||||
WALKING_ON_SEA,
|
||||
EMBARK_AND_DISEMBARK,
|
||||
TELEPORT_TWO_WAY, // Two-way monoliths and Subterranean Gate
|
||||
TELEPORT_ONE_WAY, // One-way monoliths with one known exit only
|
||||
TELEPORT_ONE_WAY_RANDOM, // One-way monoliths with more than one known exit
|
||||
TELEPORT_WHIRLPOOL // Force enabled if hero protected or unaffected (have one stack of one creature)
|
||||
bool useFlying;
|
||||
bool useWaterWalking;
|
||||
bool useEmbarkAndDisembark;
|
||||
bool useTeleportTWoWay; // Two-way monoliths and Subterranean Gate
|
||||
bool useTeleportOneWay; // One-way monoliths with one known exit only
|
||||
bool useTeleportOneWayRandom; // One-way monoliths with more than one known exit
|
||||
bool useTeleportWhirlpool; // Force enabled if hero protected or unaffected (have one stack of one creature)
|
||||
|
||||
PathfinderOptions();
|
||||
};
|
||||
std::set<EOptions> options;
|
||||
PathfinderOptions options;
|
||||
|
||||
CPathsInfo &out;
|
||||
const CGHeroInstance *hero;
|
||||
|
||||
Reference in New Issue
Block a user