feat(Core/Misc): implement ObjectGuid class (port from TC) (#4885)

This commit is contained in:
UltraNix
2021-04-25 22:18:03 +02:00
committed by GitHub
parent 91081f4ad8
commit f4c226423d
568 changed files with 10655 additions and 11019 deletions

View File

@@ -28,7 +28,7 @@ namespace acore
struct VisibleNotifier
{
Player& i_player;
Player::ClientGUIDs vis_guids;
GuidUnorderedSet vis_guids;
std::vector<Unit*>& i_visibleNow;
bool i_gobjOnly;
bool i_largeOnly;
@@ -718,18 +718,6 @@ namespace acore
NearestGameObjectTypeInObjectRangeCheck(NearestGameObjectTypeInObjectRangeCheck const&);
};
class GameObjectWithDbGUIDCheck
{
public:
GameObjectWithDbGUIDCheck(uint32 db_guid) : i_db_guid(db_guid) {}
bool operator()(GameObject const* go) const
{
return go->GetDBTableGUIDLow() == i_db_guid;
}
private:
uint32 i_db_guid;
};
// Unit checks
class MostHPMissingInRange
@@ -859,18 +847,6 @@ namespace acore
float i_range;
};
class CreatureWithDbGUIDCheck
{
public:
CreatureWithDbGUIDCheck(uint32 lowguid) : i_lowguid(lowguid) {}
bool operator()(Creature* u)
{
return u->GetDBTableGUIDLow() == i_lowguid;
}
private:
uint32 i_lowguid;
};
class AnyFriendlyUnitInObjectRangeCheck
{
public:
@@ -1402,21 +1378,21 @@ namespace acore
class ObjectGUIDCheck
{
public:
ObjectGUIDCheck(uint64 GUID, bool equals) : _GUID(GUID), _equals(equals) {}
ObjectGUIDCheck(ObjectGuid GUID, bool equals) : _GUID(GUID), _equals(equals) {}
bool operator()(WorldObject const* object)
{
return (object->GetGUID() == _GUID) == _equals;
}
private:
uint64 _GUID;
ObjectGuid _GUID;
bool _equals;
};
class UnitAuraCheck
{
public:
UnitAuraCheck(bool present, uint32 spellId, uint64 casterGUID = 0) : _present(present), _spellId(spellId), _casterGUID(casterGUID) {}
UnitAuraCheck(bool present, uint32 spellId, ObjectGuid casterGUID = ObjectGuid::Empty) : _present(present), _spellId(spellId), _casterGUID(casterGUID) {}
bool operator()(Unit const* unit) const
{
return unit->HasAura(_spellId, _casterGUID) == _present;
@@ -1430,7 +1406,7 @@ namespace acore
private:
bool _present;
uint32 _spellId;
uint64 _casterGUID;
ObjectGuid _casterGUID;
};
class AllWorldObjectsInExactRange