<commit_before>﻿#pragma once
#include <Main.h>
#include <MumbleLink.h>
#include <list>

namespace GW2Radial
{

class Condition {
protected:
    bool negate_ = false;
    bool enable_ = false;
    [[nodiscard]] virtual bool test() const = 0;
public:
    Condition& negate(bool negate) { negate_ = negate; return *this; }
    Condition& enable(bool enable) { enable_ = enable; return *this; }

    virtual ~Condition() = default;
    [[nodiscard]] bool operator()() const { return enable_ ? true : test() != negate_; }

    friend struct ConditionSet;
};

class IsInCombatCondition final : public Condition {
    [[nodiscard]] bool test() const override;
};

class IsWvWCondition final : public Condition {
    [[nodiscard]] bool test() const override;
};

class IsUnderwaterCondition final : public Condition {
    [[nodiscard]] bool test() const override;<commit_msg>Fixed inverted enable flag on conditions.<commit_after>﻿#pragma once
#include <Main.h>
#include <MumbleLink.h>
#include <list>

namespace GW2Radial
{

class Condition {
protected:
    bool negate_ = false;
    bool enable_ = false;
    [[nodiscard]] virtual bool test() const = 0;
public:
    Condition& negate(bool negate) { negate_ = negate; return *this; }
    Condition& enable(bool enable) { enable_ = enable; return *this; }

    virtual ~Condition() = default;
    [[nodiscard]] bool operator()() const { return enable_ ? test() != negate_ : true; }

    friend struct ConditionSet;
};

class IsInCombatCondition final : public Condition {
    [[nodiscard]] bool test() const override;
};

class IsWvWCondition final : public Condition {
    [[nodiscard]] bool test() const override;
};

class IsUnderwaterCondition final : public Condition {
    [[nodiscard]] bool test() const override;
{'fraction_non_alphanumeric': 0.12088535754824063, 'fraction_numerical': 0.0022701475595913734, 'mean_word_length': 4.2942942942942945, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6174376', 'n_tokens_mistral': 530, 'n_tokens_neox': 519, 'n_words': 174}