mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-06 18:54:13 +00:00
format codebase
This commit is contained in:
@@ -6,26 +6,26 @@
|
||||
|
||||
enum class PreconditionType
|
||||
{
|
||||
ItemEquipped,
|
||||
ItemNotEquipped,
|
||||
HasItem,
|
||||
DoesNotHaveItem,
|
||||
HasAchievement,
|
||||
MissionAvailable,
|
||||
OnMission,
|
||||
MissionComplete,
|
||||
PetDeployed,
|
||||
HasFlag,
|
||||
WithinShape,
|
||||
InBuild,
|
||||
TeamCheck,
|
||||
IsPetTaming,
|
||||
HasFaction,
|
||||
DoesNotHaveFaction,
|
||||
HasRacingLicence,
|
||||
DoesNotHaveRacingLicence,
|
||||
LegoClubMember,
|
||||
NoInteraction,
|
||||
ItemEquipped,
|
||||
ItemNotEquipped,
|
||||
HasItem,
|
||||
DoesNotHaveItem,
|
||||
HasAchievement,
|
||||
MissionAvailable,
|
||||
OnMission,
|
||||
MissionComplete,
|
||||
PetDeployed,
|
||||
HasFlag,
|
||||
WithinShape,
|
||||
InBuild,
|
||||
TeamCheck,
|
||||
IsPetTaming,
|
||||
HasFaction,
|
||||
DoesNotHaveFaction,
|
||||
HasRacingLicence,
|
||||
DoesNotHaveRacingLicence,
|
||||
LegoClubMember,
|
||||
NoInteraction,
|
||||
HasLevel = 22
|
||||
};
|
||||
|
||||
@@ -33,49 +33,49 @@ enum class PreconditionType
|
||||
class Precondition final
|
||||
{
|
||||
public:
|
||||
explicit Precondition(uint32_t condition);
|
||||
|
||||
bool Check(Entity* player, bool evaluateCosts = false) const;
|
||||
|
||||
explicit Precondition(uint32_t condition);
|
||||
|
||||
bool Check(Entity* player, bool evaluateCosts = false) const;
|
||||
|
||||
private:
|
||||
bool CheckValue(Entity* player, uint32_t value, bool evaluateCosts = false) const;
|
||||
|
||||
PreconditionType type;
|
||||
bool CheckValue(Entity* player, uint32_t value, bool evaluateCosts = false) const;
|
||||
|
||||
std::vector<uint32_t> values;
|
||||
PreconditionType type;
|
||||
|
||||
uint32_t count;
|
||||
std::vector<uint32_t> values;
|
||||
|
||||
uint32_t count;
|
||||
};
|
||||
|
||||
|
||||
class PreconditionExpression final
|
||||
{
|
||||
public:
|
||||
explicit PreconditionExpression(const std::string& conditions);
|
||||
explicit PreconditionExpression(const std::string& conditions);
|
||||
|
||||
bool Check(Entity* player, bool evaluateCosts = false) const;
|
||||
|
||||
~PreconditionExpression();
|
||||
|
||||
bool Check(Entity* player, bool evaluateCosts = false) const;
|
||||
|
||||
~PreconditionExpression();
|
||||
|
||||
private:
|
||||
uint32_t condition = 0;
|
||||
uint32_t condition = 0;
|
||||
|
||||
bool m_or = false;
|
||||
bool m_or = false;
|
||||
|
||||
bool empty = false;
|
||||
bool empty = false;
|
||||
|
||||
PreconditionExpression* next = nullptr;
|
||||
PreconditionExpression* next = nullptr;
|
||||
};
|
||||
|
||||
class Preconditions final
|
||||
{
|
||||
public:
|
||||
static bool Check(Entity* player, uint32_t condition, bool evaluateCosts = false);
|
||||
static bool Check(Entity* player, uint32_t condition, bool evaluateCosts = false);
|
||||
|
||||
static PreconditionExpression CreateExpression(const std::string& conditions);
|
||||
static PreconditionExpression CreateExpression(const std::string& conditions);
|
||||
|
||||
~Preconditions();
|
||||
|
||||
|
||||
private:
|
||||
static std::map<uint32_t, Precondition*> cache;
|
||||
static std::map<uint32_t, Precondition*> cache;
|
||||
};
|
||||
|
Reference in New Issue
Block a user