test: ms_time

This commit is contained in:
Yunfan Li
2023-08-02 03:46:15 +08:00
parent b35b8ad997
commit fca4d17c97
26 changed files with 91 additions and 82 deletions

View File

@@ -16,7 +16,7 @@ class Unit;
class AttackersValue : public ObjectGuidListCalculatedValue
{
public:
AttackersValue(PlayerbotAI* botAI) : ObjectGuidListCalculatedValue(botAI, "attackers", 2) { }
AttackersValue(PlayerbotAI* botAI) : ObjectGuidListCalculatedValue(botAI, "attackers", 2 * 1000) { }
GuidVector Calculate();
static bool IsPossibleTarget(Unit* attacker, Player* bot, float range = sPlayerbotAIConfig->sightDistance);

View File

@@ -24,7 +24,7 @@ class NearestEnemyPlayersValue : public PossibleTargetsValue
class EnemyPlayerValue : public UnitCalculatedValue
{
public:
EnemyPlayerValue(PlayerbotAI* botAI, std::string const name = "enemy player") : UnitCalculatedValue(botAI, name, 2) { }
EnemyPlayerValue(PlayerbotAI* botAI, std::string const name = "enemy player") : UnitCalculatedValue(botAI, name, 2 * 1000) { }
Unit* Calculate() override;

View File

@@ -10,7 +10,7 @@ class PlayerbotAI;
class GroupMembersValue : public ObjectGuidListCalculatedValue
{
public:
GroupMembersValue(PlayerbotAI* botAI) : ObjectGuidListCalculatedValue(botAI, "group members", 2) { }
GroupMembersValue(PlayerbotAI* botAI) : ObjectGuidListCalculatedValue(botAI, "group members", 2 * 1000) { }
GuidVector Calculate() override;
};
@@ -66,7 +66,7 @@ class GroupBoolORValue : public BoolCalculatedValue, public Qualified
class GroupReadyValue : public BoolCalculatedValue, public Qualified
{
public:
GroupReadyValue(PlayerbotAI* botAI) : BoolCalculatedValue(botAI, "group ready", 2) { }
GroupReadyValue(PlayerbotAI* botAI) : BoolCalculatedValue(botAI, "group ready", 2 * 2000) { }
bool Calculate()override;
};

View File

@@ -15,7 +15,7 @@ class SpellInfo;
class ItemForSpellValue : public CalculatedValue<Item*>, public Qualified
{
public:
ItemForSpellValue(PlayerbotAI* botAI, std::string const name = "item for spell") : CalculatedValue<Item*>(botAI, name) { }
ItemForSpellValue(PlayerbotAI* botAI, std::string const name = "item for spell") : CalculatedValue<Item*>(botAI, name, 20 * 1000) { }
Item* Calculate() override;

View File

@@ -59,7 +59,7 @@ typedef std::unordered_map<ItemUsage, std::vector<uint32>> itemUsageMap;
class EntryLootUsageValue : public CalculatedValue<itemUsageMap>, public Qualified
{
public:
EntryLootUsageValue(PlayerbotAI* botAI) : CalculatedValue(botAI, "entry loot usage", 2) { }
EntryLootUsageValue(PlayerbotAI* botAI) : CalculatedValue(botAI, "entry loot usage", 2 * 1000) { }
itemUsageMap Calculate() override;
};
@@ -67,7 +67,7 @@ class EntryLootUsageValue : public CalculatedValue<itemUsageMap>, public Qualifi
class HasUpgradeValue : public BoolCalculatedValue, public Qualified
{
public:
HasUpgradeValue(PlayerbotAI* botAI) : BoolCalculatedValue(botAI, "has upgrade", 2) { }
HasUpgradeValue(PlayerbotAI* botAI) : BoolCalculatedValue(botAI, "has upgrade", 2 * 1000) { }
bool Calculate() override;
};

View File

@@ -12,7 +12,7 @@ class PlayerbotAI;
class CanMoveAroundValue : public BoolCalculatedValue
{
public:
CanMoveAroundValue(PlayerbotAI* botAI) : BoolCalculatedValue(botAI, "can move around", 2) { }
CanMoveAroundValue(PlayerbotAI* botAI) : BoolCalculatedValue(botAI, "can move around", 2 * 2000) { }
bool Calculate() override;
};
@@ -20,7 +20,7 @@ class CanMoveAroundValue : public BoolCalculatedValue
class ShouldHomeBindValue : public BoolCalculatedValue
{
public:
ShouldHomeBindValue(PlayerbotAI* botAI) : BoolCalculatedValue(botAI, "should home bind", 2) { }
ShouldHomeBindValue(PlayerbotAI* botAI) : BoolCalculatedValue(botAI, "should home bind", 2 * 2000) { }
bool Calculate() override;
};
@@ -28,7 +28,7 @@ class ShouldHomeBindValue : public BoolCalculatedValue
class ShouldRepairValue : public BoolCalculatedValue
{
public:
ShouldRepairValue(PlayerbotAI* botAI) : BoolCalculatedValue(botAI,"should repair",2) { }
ShouldRepairValue(PlayerbotAI* botAI) : BoolCalculatedValue(botAI,"should repair",2 * 2000) { }
bool Calculate() override;
};
@@ -36,7 +36,7 @@ class ShouldRepairValue : public BoolCalculatedValue
class CanRepairValue : public BoolCalculatedValue
{
public:
CanRepairValue(PlayerbotAI* botAI) : BoolCalculatedValue(botAI, "can repair",2) { }
CanRepairValue(PlayerbotAI* botAI) : BoolCalculatedValue(botAI, "can repair",2 * 2000) { }
bool Calculate() override;
};
@@ -44,7 +44,7 @@ class CanRepairValue : public BoolCalculatedValue
class ShouldSellValue : public BoolCalculatedValue
{
public:
ShouldSellValue(PlayerbotAI* botAI) : BoolCalculatedValue(botAI, "should sell",2) { }
ShouldSellValue(PlayerbotAI* botAI) : BoolCalculatedValue(botAI, "should sell",2 * 2000) { }
bool Calculate() override;
};
@@ -52,7 +52,7 @@ class ShouldSellValue : public BoolCalculatedValue
class CanSellValue : public BoolCalculatedValue
{
public:
CanSellValue(PlayerbotAI* botAI) : BoolCalculatedValue(botAI, "can sell",2) { }
CanSellValue(PlayerbotAI* botAI) : BoolCalculatedValue(botAI, "can sell",2 * 2000) { }
bool Calculate() override;
};
@@ -60,7 +60,7 @@ class CanSellValue : public BoolCalculatedValue
class CanFightEqualValue: public BoolCalculatedValue
{
public:
CanFightEqualValue(PlayerbotAI* botAI) : BoolCalculatedValue(botAI, "can fight equal",2) { }
CanFightEqualValue(PlayerbotAI* botAI) : BoolCalculatedValue(botAI, "can fight equal",2 * 2000) { }
bool Calculate() override;
};

View File

@@ -14,7 +14,7 @@ class NearestGameObjects : public ObjectGuidListCalculatedValue
{
public:
NearestGameObjects(PlayerbotAI* botAI, float range = sPlayerbotAIConfig->sightDistance, bool ignoreLos = false, std::string const name = "nearest game objects") :
ObjectGuidListCalculatedValue(botAI, name), range(range) , ignoreLos(ignoreLos) { }
ObjectGuidListCalculatedValue(botAI, name, 2 * 1000), range(range) , ignoreLos(ignoreLos) { }
protected:
GuidVector Calculate() override;

View File

@@ -15,7 +15,7 @@ class NearestUnitsValue : public ObjectGuidListCalculatedValue
{
public:
NearestUnitsValue(PlayerbotAI* botAI, std::string const name = "nearest units", float range = sPlayerbotAIConfig->sightDistance, bool ignoreLos = false) :
ObjectGuidListCalculatedValue(botAI, name, 2), range(range), ignoreLos(ignoreLos) { }
ObjectGuidListCalculatedValue(botAI, name, 2 * 1000), range(range), ignoreLos(ignoreLos) { }
GuidVector Calculate() override;

View File

@@ -14,7 +14,7 @@ class Unit;
class PartyMemberToDispel : public PartyMemberValue, public Qualified
{
public:
PartyMemberToDispel(PlayerbotAI* botAI, std::string const name = "party member to dispel") : PartyMemberValue(botAI, name, 2), Qualified() { }
PartyMemberToDispel(PlayerbotAI* botAI, std::string const name = "party member to dispel") : PartyMemberValue(botAI, name, 2 * 1000), Qualified() { }
protected:
Unit* Calculate() override;

View File

@@ -38,7 +38,7 @@ class PartyMemberValue : public UnitCalculatedValue
class PartyMemberMainTankValue : public PartyMemberValue
{
public:
PartyMemberMainTankValue(PlayerbotAI* botAI) : PartyMemberValue(botAI, "main tank member", 2) {}
PartyMemberMainTankValue(PlayerbotAI* botAI) : PartyMemberValue(botAI, "main tank member", 2 * 1000) {}
virtual Unit* Calculate();
};

View File

@@ -7,7 +7,7 @@
#include "Playerbots.h"
#include "Vehicle.h"
SpellIdValue::SpellIdValue(PlayerbotAI* botAI) : CalculatedValue<uint32>(botAI, "spell id")
SpellIdValue::SpellIdValue(PlayerbotAI* botAI) : CalculatedValue<uint32>(botAI, "spell id", 20 * 1000)
{
}

View File

@@ -64,7 +64,7 @@ class TravelTargetValue : public ManualSetValue<TravelTarget*>
class LastLongMoveValue : public CalculatedValue<WorldPosition>
{
public:
LastLongMoveValue(PlayerbotAI* botAI) : CalculatedValue<WorldPosition>(botAI, "last long move", 30) { }
LastLongMoveValue(PlayerbotAI* botAI) : CalculatedValue<WorldPosition>(botAI, "last long move", 30 * 1000) { }
WorldPosition Calculate() override;
};
@@ -72,7 +72,7 @@ class LastLongMoveValue : public CalculatedValue<WorldPosition>
class HomeBindValue : public CalculatedValue<WorldPosition>
{
public:
HomeBindValue(PlayerbotAI* botAI) : CalculatedValue<WorldPosition>(botAI, "home bind", 30) { }
HomeBindValue(PlayerbotAI* botAI) : CalculatedValue<WorldPosition>(botAI, "home bind", 30 * 1000) { }
WorldPosition Calculate() override;
};
@@ -101,7 +101,7 @@ class PullTargetValue : public ManualSetValue<ObjectGuid>
class FindTargetValue : public UnitCalculatedValue, public Qualified
{
public:
FindTargetValue(PlayerbotAI* ai) : UnitCalculatedValue(ai, "find target", 2) {}
FindTargetValue(PlayerbotAI* ai) : UnitCalculatedValue(ai, "find target", 2 * 1000) {}
public:
Unit* Calculate();
@@ -117,7 +117,7 @@ class FindBossTargetStrategy : public FindTargetStrategy
class BossTargetValue : public TargetValue, public Qualified
{
public:
BossTargetValue(PlayerbotAI* ai) : TargetValue(ai, "boss target", 1) {}
BossTargetValue(PlayerbotAI* ai) : TargetValue(ai, "boss target", 2 * 1000) {}
public:
Unit* Calculate();