Run clang-format

This commit is contained in:
Yunfan Li
2024-08-04 10:23:36 +08:00
parent 44da167492
commit 53611c9040
835 changed files with 35085 additions and 31861 deletions

View File

@@ -1,4 +1,5 @@
#include "RaidBwlActions.h"
#include "Playerbots.h"
bool BwlOnyxiaScaleCloakAuraCheckAction::Execute(Event event)
@@ -7,10 +8,7 @@ bool BwlOnyxiaScaleCloakAuraCheckAction::Execute(Event event)
return true;
}
bool BwlOnyxiaScaleCloakAuraCheckAction::isUseful()
{
return !bot->HasAura(22683);
}
bool BwlOnyxiaScaleCloakAuraCheckAction::isUseful() { return !bot->HasAura(22683); }
bool BwlTurnOffSuppressionDeviceAction::Execute(Event event)
{
@@ -18,10 +16,12 @@ bool BwlTurnOffSuppressionDeviceAction::Execute(Event event)
for (GuidVector::iterator i = gos.begin(); i != gos.end(); i++)
{
GameObject* go = botAI->GetGameObject(*i);
if (!go) {
if (!go)
{
continue;
}
if (go->GetEntry() != 179784 || go->GetDistance(bot) >= 15.0f || go->GetGoState() != GO_STATE_READY) {
if (go->GetEntry() != 179784 || go->GetDistance(bot) >= 15.0f || go->GetGoState() != GO_STATE_READY)
{
continue;
}
go->SetGoState(GO_STATE_ACTIVE);

View File

@@ -2,25 +2,25 @@
#define _PLAYERBOT_RAIDBWLACTIONS_H
#include "Action.h"
#include "MovementActions.h"
#include "AttackAction.h"
#include "GenericActions.h"
#include "MovementActions.h"
#include "PlayerbotAI.h"
#include "Playerbots.h"
class BwlOnyxiaScaleCloakAuraCheckAction : public Action
{
public:
BwlOnyxiaScaleCloakAuraCheckAction(PlayerbotAI* botAI) : Action(botAI, "bwl onyxia scale cloak aura check") {}
bool Execute(Event event) override;
bool isUseful() override;
public:
BwlOnyxiaScaleCloakAuraCheckAction(PlayerbotAI* botAI) : Action(botAI, "bwl onyxia scale cloak aura check") {}
bool Execute(Event event) override;
bool isUseful() override;
};
class BwlTurnOffSuppressionDeviceAction : public Action
{
public:
BwlTurnOffSuppressionDeviceAction(PlayerbotAI* botAI) : Action(botAI, "bwl turn off suppression device") {}
bool Execute(Event event) override;
public:
BwlTurnOffSuppressionDeviceAction(PlayerbotAI* botAI) : Action(botAI, "bwl turn off suppression device") {}
bool Execute(Event event) override;
};
#endif

View File

@@ -1,13 +1,13 @@
#include "RaidBwlStrategy.h"
#include "Strategy.h"
void RaidBwlStrategy::InitTriggers(std::vector<TriggerNode*> &triggers)
void RaidBwlStrategy::InitTriggers(std::vector<TriggerNode*>& triggers)
{
triggers.push_back(new TriggerNode(
"often",
NextAction::array(0, new NextAction("bwl check onyxia scale cloak", ACTION_RAID), NULL)));
"often", NextAction::array(0, new NextAction("bwl check onyxia scale cloak", ACTION_RAID), NULL)));
triggers.push_back(new TriggerNode(
"bwl suppression device",
NextAction::array(0, new NextAction("bwl turn off suppression device", ACTION_RAID), NULL)));
triggers.push_back(
new TriggerNode("bwl suppression device",
NextAction::array(0, new NextAction("bwl turn off suppression device", ACTION_RAID), NULL)));
}

View File

@@ -2,8 +2,8 @@
#ifndef _PLAYERBOT_RAIDBWLSTRATEGY_H
#define _PLAYERBOT_RAIDBWLSTRATEGY_H
#include "Multiplier.h"
#include "AiObjectContext.h"
#include "Multiplier.h"
#include "Strategy.h"
class RaidBwlStrategy : public Strategy
@@ -11,9 +11,8 @@ class RaidBwlStrategy : public Strategy
public:
RaidBwlStrategy(PlayerbotAI* ai) : Strategy(ai) {}
virtual std::string const getName() override { return "bwl"; }
virtual void InitTriggers(std::vector<TriggerNode*> &triggers) override;
virtual void InitTriggers(std::vector<TriggerNode*>& triggers) override;
// virtual void InitMultipliers(std::vector<Multiplier*> &multipliers) override;
};
#endif

View File

@@ -1,15 +1,19 @@
#include "RaidBwlTriggers.h"
#include "SharedDefines.h"
bool BwlSuppressionDeviceTrigger::IsActive() {
bool BwlSuppressionDeviceTrigger::IsActive()
{
GuidVector gos = AI_VALUE(GuidVector, "nearest game objects");
for (GuidVector::iterator i = gos.begin(); i != gos.end(); i++)
{
GameObject* go = botAI->GetGameObject(*i);
if (!go) {
if (!go)
{
continue;
}
if (go->GetEntry() != 179784 || go->GetDistance(bot) >= 15.0f || go->GetGoState() != GO_STATE_READY) {
if (go->GetEntry() != 179784 || go->GetDistance(bot) >= 15.0f || go->GetGoState() != GO_STATE_READY)
{
continue;
}
return true;

View File

@@ -1,15 +1,15 @@
#ifndef _PLAYERBOT_RAIDBWLTRIGGERS_H
#define _PLAYERBOT_RAIDBWLTRIGGERS_H
#include "Trigger.h"
#include "PlayerbotAI.h"
#include "Playerbots.h"
#include "Trigger.h"
class BwlSuppressionDeviceTrigger : public Trigger
class BwlSuppressionDeviceTrigger : public Trigger
{
public:
BwlSuppressionDeviceTrigger(PlayerbotAI* botAI) : Trigger(botAI, "bwl suppression device") {}
bool IsActive() override;
public:
BwlSuppressionDeviceTrigger(PlayerbotAI* botAI) : Trigger(botAI, "bwl suppression device") {}
bool IsActive() override;
};
#endif