diff --git a/Class/Warrior/Buffs/DefensiveStanceBuff.cpp b/Class/Warrior/Buffs/DefensiveStanceBuff.cpp index 9eb8aa147..9639b0af4 100644 --- a/Class/Warrior/Buffs/DefensiveStanceBuff.cpp +++ b/Class/Warrior/Buffs/DefensiveStanceBuff.cpp @@ -8,13 +8,13 @@ DefensiveStanceBuff::DefensiveStanceBuff(Warrior* warrior) : SelfBuff(warrior, "Defensive Stance", NO_ICON, BuffDuration::PERMANENT, 1), - warrior(warrior), TalentRequirer(QVector {new TalentRequirerInfo("Defiance", 5, DisabledAtZero::No)}), + warrior(warrior), current_threat_mod(30) { this->hidden = true; } -void DefensiveStanceBuff::increase_talent_rank_effect(const QString& talent_name, const int curr) { +void DefensiveStanceBuff::increase_talent_rank_effect(const QString& /* talent_name */, const int curr) { if (warrior->in_defensive_stance()) warrior->get_stats()->decrease_total_threat_mod(std::round(current_threat_mod)); current_threat_mod = (130 * (1 + 0.03 * curr)) - 100; @@ -22,7 +22,7 @@ void DefensiveStanceBuff::increase_talent_rank_effect(const QString& talent_name warrior->get_stats()->increase_total_threat_mod(std::round(current_threat_mod)); } -void DefensiveStanceBuff::decrease_talent_rank_effect(const QString& talent_name, const int curr) { +void DefensiveStanceBuff::decrease_talent_rank_effect(const QString& /* talent_name */, const int curr) { if (warrior->in_defensive_stance()) warrior->get_stats()->decrease_total_threat_mod(std::round(current_threat_mod)); current_threat_mod = (130 * (1 + 0.03 * curr)) - 100; diff --git a/Engine/Engine.cpp b/Engine/Engine.cpp index 5cd161c98..1b3f6b8d5 100644 --- a/Engine/Engine.cpp +++ b/Engine/Engine.cpp @@ -5,7 +5,7 @@ #include "StatisticsEngine.h" #include "Utils/Check.h" -Engine::Engine() : queue(new Queue()), timer(new QTime()), current_prio(0) {} +Engine::Engine() : queue(new Queue()), timer(new QElapsedTimer()), current_prio(0) {} Engine::~Engine() { delete queue; @@ -37,7 +37,7 @@ void Engine::prepare_iteration(const double start_at) { void Engine::reset() { engine_statistics->set_elapsed(static_cast(timer->elapsed())); delete timer; - timer = new QTime(); + timer = new QElapsedTimer(); } void Engine::end_combat() { diff --git a/Engine/Engine.h b/Engine/Engine.h index fd2b3acd3..8a515b75b 100644 --- a/Engine/Engine.h +++ b/Engine/Engine.h @@ -1,7 +1,7 @@ #pragma once +#include #include -#include class Event; class Queue; @@ -26,7 +26,7 @@ class Engine { private: Queue* queue; StatisticsEngine* engine_statistics {nullptr}; - QTime* timer; + QElapsedTimer* timer; double current_prio; }; diff --git a/Event/Event.cpp b/Event/Event.cpp index 5dbbfc532..ea8fd5daf 100644 --- a/Event/Event.cpp +++ b/Event/Event.cpp @@ -50,6 +50,8 @@ QString Event::get_name_for_event_type(const EventType event_type) { return "RangedHit"; case EventType::SpellCallback: return "SpellCallback"; + case EventType::IncomingDamage: + return "IncomingDamage"; } return ""; diff --git a/Event/Events/IncomingDamageEvent.cpp b/Event/Events/IncomingDamageEvent.cpp index 6d0da6fa4..705eb4412 100644 --- a/Event/Events/IncomingDamageEvent.cpp +++ b/Event/Events/IncomingDamageEvent.cpp @@ -10,7 +10,7 @@ #include "PhysicalAttackResult.h" IncomingDamageEvent::IncomingDamageEvent(Character* character, Engine* engine, const int timestamp) : - character(character), roll(new CombatRoll(character)), Event(EventType::IncomingDamage, static_cast(timestamp)), engine(engine) {} + Event(EventType::IncomingDamage, static_cast(timestamp)), character(character), roll(new CombatRoll(character)), engine(engine) {} void IncomingDamageEvent::act() { engine->add_event(new IncomingDamageEvent(character, engine, engine->get_current_priority() + 1.5)); diff --git a/Event/Events/IncomingDamageEvent.h b/Event/Events/IncomingDamageEvent.h index 136f0f698..35ff861e1 100644 --- a/Event/Events/IncomingDamageEvent.h +++ b/Event/Events/IncomingDamageEvent.h @@ -7,13 +7,12 @@ class Engine; class IncomingDamageEvent : public Event { public: - IncomingDamageEvent(Character *character, Engine *engine, - const int timestamp); + IncomingDamageEvent(Character* character, Engine* engine, const int timestamp); - void act() override; + void act() override; private: - Engine *engine; - Character *character; - CombatRoll *roll; + Character* character; + CombatRoll* roll; + Engine* engine; }; diff --git a/GUI/Models/Statistics/ScaleResultModel.h b/GUI/Models/Statistics/ScaleResultModel.h index 3c8838a7e..cfce24c10 100644 --- a/GUI/Models/Statistics/ScaleResultModel.h +++ b/GUI/Models/Statistics/ScaleResultModel.h @@ -42,8 +42,8 @@ class ScaleResultModel : public QAbstractListModel { QHash roleNames() const; private: - bool for_dps; NumberCruncher* statistics_source; + bool for_dps; QMap sorting_methods; QList scale_results; ScaleResultSorting::Methods current_sorting_method; diff --git a/Rotation/RotationFileReader.cpp b/Rotation/RotationFileReader.cpp index b4c3d2cd7..22fd86fed 100644 --- a/Rotation/RotationFileReader.cpp +++ b/Rotation/RotationFileReader.cpp @@ -131,7 +131,7 @@ void RotationFileReader::rotation_file_handler(QXmlStreamReader& reader, Rotatio } bool RotationFileReader::rotation_executor_handler(QXmlStreamReader& reader, RotationExecutor* executor) { - QStringList expressions = reader.readElementText().trimmed().split('\n', QString::SkipEmptyParts); + QStringList expressions = reader.readElementText().trimmed().split('\n', Qt::SkipEmptyParts); for (auto& str : expressions) str = str.trimmed(); @@ -142,7 +142,7 @@ bool RotationFileReader::rotation_executor_handler(QXmlStreamReader& reader, Rot // First sentence does not have logical connective at start. // [TYPE] "[TYPE_VALUE]" [COMPARE_OPERATION] // Split into [TYPE, TYPE_VALUE, COMPARE_OPERATION] - QStringList quotation_split = expressions.takeFirst().split('"', QString::SkipEmptyParts); + QStringList quotation_split = expressions.takeFirst().split('"', Qt::SkipEmptyParts); for (auto& str : quotation_split) str = str.trimmed(); @@ -175,7 +175,7 @@ bool RotationFileReader::rotation_executor_handler(QXmlStreamReader& reader, Rot executor->add_sentence(sentence); for (int i = 0; i < expressions.size(); ++i) { - quotation_split = expressions[i].split('"', QString::SkipEmptyParts); + quotation_split = expressions[i].split('"', Qt::SkipEmptyParts); for (auto& str : quotation_split) str = str.trimmed(); @@ -187,7 +187,7 @@ bool RotationFileReader::rotation_executor_handler(QXmlStreamReader& reader, Rot sentence = new Sentence(); - QStringList logical_connective_split = quotation_split.takeFirst().split(' ', QString::SkipEmptyParts); + QStringList logical_connective_split = quotation_split.takeFirst().split(' ', Qt::SkipEmptyParts); // Else LOGICAL CONNECTIVE if (logical_connective_split.size() != 2) { qDebug() << "Expected logical operator split size of 2, got:" << logical_connective_split; @@ -258,7 +258,7 @@ bool RotationFileReader::add_compare_operation(Sentence* sentence, QString& comp QSet cmp_by_float = {"greater", "geq", "eq", "leq", "less"}; QSet cmp_by_bool = {"is"}; - QStringList cmp_operation_split = compare_operation.split(' ', QString::SkipEmptyParts); + QStringList cmp_operation_split = compare_operation.split(' ', Qt::SkipEmptyParts); if (cmp_operation_split.empty()) { qDebug() << "Compare operation split returned empty split"; return false;