-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPriorityAction.h
54 lines (49 loc) · 1.93 KB
/
PriorityAction.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#ifndef PRIORITYACTION_H
#define PRIORITYACTION_H
#include <vector>
#include "Enemy.h"
#include "Ability.h"
class PlayerCharacter;
#define STR(x) #x
#define SET_PREDICATE_WITH_TEXT(PA, predicate) PA->setPredicate(predicate); PA->setPredicateText(STR(predicate));
class PriorityAction
{
Ability *ability = nullptr;
std::function<bool (PlayerCharacter *PC, float timestamp)> predicate = nullptr;
bool ignoreGcd = false;
bool ignoreResourceCost = false;
std::string predicateText = "";
std::string nameOverride = "";
std::string internalName = "";
bool disabled = false;
bool skipToNextActionIfUseConditionFails = true;
public:
PriorityAction(Ability *ability, int32_t rank=1);
Ability *getAbility() const;
void setAbility(Ability *value);
std::function<bool (PlayerCharacter *PC, float timestamp)> getPredicate() const;
void setPredicate(const std::function<bool (PlayerCharacter *PC, float timestamp)> &value);
void triggerAbilityDamageMeleeHooks(PlayerCharacter *PC);
void execute(PlayerCharacter *PC, std::vector<Enemy *>& enemyList, float timestamp, bool shouldTriggerCooldown=true);
bool getIgnoreGcd() const;
void setIgnoreGcd(bool value);
bool getIgnoreResourceCost() const;
void setIgnoreResourceCost(bool value);
std::string getPredicateText() const;
void setPredicateText(const std::string &value);
std::string getNameOverride() const;
void setNameOverride(const std::string &value);
bool hasNameOverride() {
return this->nameOverride.length() > 0;
}
std::string getInternalName() const;
void setInternalName(const std::string &value);
bool getDisabled() const;
void setDisabled(bool value);
bool isMainhandAutoAttack();
bool isOffhandAutoAttack();
bool isAnyAutoAttack();
bool getSkipToNextActionIfUseConditionFails() const;
void setSkipToNextActionIfUseConditionFails(bool value);
};
#endif // PRIORITYACTION_H