mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-23 05:36:23 +00:00
refactor(Core/Game): restyle game lib with astyle (#3466)
This commit is contained in:
@@ -31,9 +31,9 @@
|
||||
#include "UpdateFieldFlags.h"
|
||||
|
||||
Roll::Roll(uint64 _guid, LootItem const& li) : itemGUID(_guid), itemid(li.itemid),
|
||||
itemRandomPropId(li.randomPropertyId), itemRandomSuffix(li.randomSuffix), itemCount(li.count),
|
||||
totalPlayersRolling(0), totalNeed(0), totalGreed(0), totalPass(0), itemSlot(0),
|
||||
rollVoteMask(ROLL_ALL_TYPE_NO_DISENCHANT)
|
||||
itemRandomPropId(li.randomPropertyId), itemRandomSuffix(li.randomSuffix), itemCount(li.count),
|
||||
totalPlayersRolling(0), totalNeed(0), totalGreed(0), totalPass(0), itemSlot(0),
|
||||
rollVoteMask(ROLL_ALL_TYPE_NO_DISENCHANT)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -52,10 +52,10 @@ Loot* Roll::getLoot()
|
||||
}
|
||||
|
||||
Group::Group() : m_leaderGuid(0), m_leaderName(""), m_groupType(GROUPTYPE_NORMAL),
|
||||
m_dungeonDifficulty(DUNGEON_DIFFICULTY_NORMAL), m_raidDifficulty(RAID_DIFFICULTY_10MAN_NORMAL),
|
||||
m_bfGroup(nullptr), m_bgGroup(nullptr), m_lootMethod(FREE_FOR_ALL), m_lootThreshold(ITEM_QUALITY_UNCOMMON), m_looterGuid(0),
|
||||
m_masterLooterGuid(0), m_subGroupsCounts(nullptr), m_guid(0), m_counter(0), m_maxEnchantingLevel(0), _difficultyChangePreventionTime(0),
|
||||
_difficultyChangePreventionType(DIFFICULTY_PREVENTION_CHANGE_NONE)
|
||||
m_dungeonDifficulty(DUNGEON_DIFFICULTY_NORMAL), m_raidDifficulty(RAID_DIFFICULTY_10MAN_NORMAL),
|
||||
m_bfGroup(nullptr), m_bgGroup(nullptr), m_lootMethod(FREE_FOR_ALL), m_lootThreshold(ITEM_QUALITY_UNCOMMON), m_looterGuid(0),
|
||||
m_masterLooterGuid(0), m_subGroupsCounts(nullptr), m_guid(0), m_counter(0), m_maxEnchantingLevel(0), _difficultyChangePreventionTime(0),
|
||||
_difficultyChangePreventionType(DIFFICULTY_PREVENTION_CHANGE_NONE)
|
||||
{
|
||||
for (uint8 i = 0; i < TARGETICONCOUNT; ++i)
|
||||
m_targetIcons[i] = 0;
|
||||
@@ -76,7 +76,7 @@ Group::~Group()
|
||||
while (!RollId.empty())
|
||||
{
|
||||
itr = RollId.begin();
|
||||
Roll *r = *itr;
|
||||
Roll* r = *itr;
|
||||
RollId.erase(itr);
|
||||
delete(r);
|
||||
}
|
||||
@@ -178,7 +178,7 @@ bool Group::LoadGroupFromDB(Field* fields)
|
||||
m_lootThreshold = ItemQualities(fields[3].GetUInt8());
|
||||
|
||||
for (uint8 i = 0; i < TARGETICONCOUNT; ++i)
|
||||
m_targetIcons[i] = fields[4+i].GetUInt32();
|
||||
m_targetIcons[i] = fields[4 + i].GetUInt32();
|
||||
|
||||
m_groupType = GroupType(fields[12].GetUInt8());
|
||||
if (m_groupType & GROUPTYPE_RAID)
|
||||
@@ -192,9 +192,9 @@ bool Group::LoadGroupFromDB(Field* fields)
|
||||
|
||||
uint32 r_diff = fields[14].GetUInt8();
|
||||
if (r_diff >= MAX_RAID_DIFFICULTY)
|
||||
m_raidDifficulty = RAID_DIFFICULTY_10MAN_NORMAL;
|
||||
m_raidDifficulty = RAID_DIFFICULTY_10MAN_NORMAL;
|
||||
else
|
||||
m_raidDifficulty = Difficulty(r_diff);
|
||||
m_raidDifficulty = Difficulty(r_diff);
|
||||
|
||||
m_masterLooterGuid = MAKE_NEW_GUID(fields[15].GetUInt32(), 0, HIGHGUID_PLAYER);
|
||||
|
||||
@@ -320,7 +320,7 @@ void Group::RemoveInvite(Player* player)
|
||||
|
||||
void Group::RemoveAllInvites()
|
||||
{
|
||||
for (InvitesList::iterator itr=m_invitees.begin(); itr != m_invitees.end(); ++itr)
|
||||
for (InvitesList::iterator itr = m_invitees.begin(); itr != m_invitees.end(); ++itr)
|
||||
if (*itr)
|
||||
(*itr)->SetGroupInvite(nullptr);
|
||||
|
||||
@@ -498,7 +498,7 @@ bool Group::AddMember(Player* player)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Group::RemoveMember(uint64 guid, const RemoveMethod &method /*= GROUP_REMOVEMETHOD_DEFAULT*/, uint64 kicker /*= 0*/, const char* reason /*= NULL*/)
|
||||
bool Group::RemoveMember(uint64 guid, const RemoveMethod& method /*= GROUP_REMOVEMETHOD_DEFAULT*/, uint64 kicker /*= 0*/, const char* reason /*= NULL*/)
|
||||
{
|
||||
BroadcastGroupUpdate();
|
||||
|
||||
@@ -519,7 +519,7 @@ bool Group::RemoveMember(uint64 guid, const RemoveMethod &method /*= GROUP_REMOV
|
||||
if (isBGGroup() || isBFGroup())
|
||||
player->RemoveFromBattlegroundOrBattlefieldRaid();
|
||||
else
|
||||
// Regular group
|
||||
// Regular group
|
||||
{
|
||||
if (player->GetOriginalGroup() == this)
|
||||
player->SetOriginalGroup(nullptr);
|
||||
@@ -539,7 +539,7 @@ bool Group::RemoveMember(uint64 guid, const RemoveMethod &method /*= GROUP_REMOV
|
||||
}
|
||||
|
||||
// Do we really need to send this opcode?
|
||||
data.Initialize(SMSG_GROUP_LIST, 1+1+1+1+8+4+4+8);
|
||||
data.Initialize(SMSG_GROUP_LIST, 1 + 1 + 1 + 1 + 8 + 4 + 4 + 8);
|
||||
data << uint8(0x10) << uint8(0) << uint8(0) << uint8(0);
|
||||
data << uint64(m_guid) << uint32(m_counter) << uint32(0) << uint64(0);
|
||||
player->GetSession()->SendPacket(&data);
|
||||
@@ -693,7 +693,7 @@ void Group::ChangeLeader(uint64 newLeaderGuid)
|
||||
m_leaderName = newLeader->GetName();
|
||||
ToggleGroupMemberFlag(slot, MEMBER_FLAG_ASSISTANT, false);
|
||||
|
||||
WorldPacket data(SMSG_GROUP_SET_LEADER, m_leaderName.size()+1);
|
||||
WorldPacket data(SMSG_GROUP_SET_LEADER, m_leaderName.size() + 1);
|
||||
data << slot->name;
|
||||
BroadcastPacket(&data, true);
|
||||
|
||||
@@ -750,7 +750,7 @@ void Group::Disband(bool hideDestroy /* = false */)
|
||||
}
|
||||
else
|
||||
{
|
||||
data.Initialize(SMSG_GROUP_LIST, 1+1+1+1+8+4+4+8);
|
||||
data.Initialize(SMSG_GROUP_LIST, 1 + 1 + 1 + 1 + 8 + 4 + 4 + 8);
|
||||
data << uint8(0x10) << uint8(0) << uint8(0) << uint8(0);
|
||||
data << uint64(m_guid) << uint32(m_counter) << uint32(0) << uint64(0);
|
||||
player->GetSession()->SendPacket(&data);
|
||||
@@ -788,9 +788,9 @@ void Group::Disband(bool hideDestroy /* = false */)
|
||||
/*** LOOT SYSTEM ***/
|
||||
/*********************************************************/
|
||||
|
||||
void Group::SendLootStartRoll(uint32 CountDown, uint32 mapid, const Roll &r)
|
||||
void Group::SendLootStartRoll(uint32 CountDown, uint32 mapid, const Roll& r)
|
||||
{
|
||||
WorldPacket data(SMSG_LOOT_START_ROLL, (8+4+4+4+4+4+4+1));
|
||||
WorldPacket data(SMSG_LOOT_START_ROLL, (8 + 4 + 4 + 4 + 4 + 4 + 4 + 1));
|
||||
data << uint64(r.itemGUID); // guid of rolled item
|
||||
data << uint32(mapid); // 3.3.3 mapid
|
||||
data << uint32(r.itemSlot); // itemslot
|
||||
@@ -801,7 +801,7 @@ void Group::SendLootStartRoll(uint32 CountDown, uint32 mapid, const Roll &r)
|
||||
data << uint32(CountDown); // the countdown time to choose "need" or "greed"
|
||||
data << uint8(r.rollVoteMask); // roll type mask
|
||||
|
||||
for (Roll::PlayerVote::const_iterator itr=r.playerVote.begin(); itr != r.playerVote.end(); ++itr)
|
||||
for (Roll::PlayerVote::const_iterator itr = r.playerVote.begin(); itr != r.playerVote.end(); ++itr)
|
||||
{
|
||||
Player* p = ObjectAccessor::FindPlayerInOrOutOfWorld(itr->first);
|
||||
if (!p)
|
||||
@@ -836,7 +836,7 @@ void Group::SendLootStartRollToPlayer(uint32 countDown, uint32 mapId, Player* p,
|
||||
|
||||
void Group::SendLootRoll(uint64 sourceGuid, uint64 targetGuid, uint8 rollNumber, uint8 rollType, Roll const& roll)
|
||||
{
|
||||
WorldPacket data(SMSG_LOOT_ROLL, (8+4+8+4+4+4+1+1+1));
|
||||
WorldPacket data(SMSG_LOOT_ROLL, (8 + 4 + 8 + 4 + 4 + 4 + 1 + 1 + 1));
|
||||
data << uint64(sourceGuid); // guid of the item rolled
|
||||
data << uint32(roll.itemSlot); // slot
|
||||
data << uint64(targetGuid);
|
||||
@@ -860,7 +860,7 @@ void Group::SendLootRoll(uint64 sourceGuid, uint64 targetGuid, uint8 rollNumber,
|
||||
|
||||
void Group::SendLootRollWon(uint64 sourceGuid, uint64 targetGuid, uint8 rollNumber, uint8 rollType, Roll const& roll)
|
||||
{
|
||||
WorldPacket data(SMSG_LOOT_ROLL_WON, (8+4+4+4+4+8+1+1));
|
||||
WorldPacket data(SMSG_LOOT_ROLL_WON, (8 + 4 + 4 + 4 + 4 + 8 + 1 + 1));
|
||||
data << uint64(sourceGuid); // guid of the item rolled
|
||||
data << uint32(roll.itemSlot); // slot
|
||||
data << uint32(roll.itemid); // the itemEntryId for the item that shall be rolled for
|
||||
@@ -883,7 +883,7 @@ void Group::SendLootRollWon(uint64 sourceGuid, uint64 targetGuid, uint8 rollNumb
|
||||
|
||||
void Group::SendLootAllPassed(Roll const& roll)
|
||||
{
|
||||
WorldPacket data(SMSG_LOOT_ALL_PASSED, (8+4+4+4+4));
|
||||
WorldPacket data(SMSG_LOOT_ALL_PASSED, (8 + 4 + 4 + 4 + 4));
|
||||
data << uint64(roll.itemGUID); // Guid of the item rolled
|
||||
data << uint32(roll.itemSlot); // Item loot slot
|
||||
data << uint32(roll.itemid); // The itemEntryId for the item that shall be rolled for
|
||||
@@ -906,7 +906,7 @@ void Group::SendLooter(Creature* creature, Player* groupLooter)
|
||||
{
|
||||
ASSERT(creature);
|
||||
|
||||
WorldPacket data(SMSG_LOOT_LIST, (8+8));
|
||||
WorldPacket data(SMSG_LOOT_LIST, (8 + 8));
|
||||
data << uint64(creature->GetGUID());
|
||||
|
||||
if (GetLootMethod() == MASTER_LOOT && creature->loot.hasOverThresholdItem())
|
||||
@@ -982,7 +982,7 @@ void Group::GroupLoot(Loot* loot, WorldObject* pLootedObject)
|
||||
// If there is any "auto pass", broadcast the pass now.
|
||||
if (r->totalPass)
|
||||
{
|
||||
for (Roll::PlayerVote::const_iterator itr=r->playerVote.begin(); itr != r->playerVote.end(); ++itr)
|
||||
for (Roll::PlayerVote::const_iterator itr = r->playerVote.begin(); itr != r->playerVote.end(); ++itr)
|
||||
{
|
||||
Player* p = ObjectAccessor::FindPlayer(itr->first);
|
||||
if (!p)
|
||||
@@ -1321,7 +1321,8 @@ void Group::EndRoll(Loot* pLoot, Map* allowedMap)
|
||||
{
|
||||
for (Rolls::iterator itr = RollId.begin(); itr != RollId.end();)
|
||||
{
|
||||
if ((*itr)->getLoot() == pLoot) {
|
||||
if ((*itr)->getLoot() == pLoot)
|
||||
{
|
||||
CountTheRoll(itr, allowedMap); //i don't have to edit player votes, who didn't vote ... he will pass
|
||||
itr = RollId.begin();
|
||||
}
|
||||
@@ -1349,7 +1350,7 @@ void Group::CountTheRoll(Rolls::iterator rollI, Map* allowedMap)
|
||||
uint64 maxguid = 0; // pussywizard: start with 0 >_>
|
||||
Player* player = nullptr;
|
||||
|
||||
for (Roll::PlayerVote::const_iterator itr=roll->playerVote.begin(); itr != roll->playerVote.end(); ++itr)
|
||||
for (Roll::PlayerVote::const_iterator itr = roll->playerVote.begin(); itr != roll->playerVote.end(); ++itr)
|
||||
{
|
||||
if (itr->second != NEED)
|
||||
continue;
|
||||
@@ -1502,13 +1503,13 @@ void Group::SetTargetIcon(uint8 id, uint64 whoGuid, uint64 targetGuid)
|
||||
|
||||
// clean other icons
|
||||
if (targetGuid != 0)
|
||||
for (int i=0; i<TARGETICONCOUNT; ++i)
|
||||
for (int i = 0; i < TARGETICONCOUNT; ++i)
|
||||
if (m_targetIcons[i] == targetGuid)
|
||||
SetTargetIcon(i, 0, 0);
|
||||
|
||||
m_targetIcons[id] = targetGuid;
|
||||
|
||||
WorldPacket data(MSG_RAID_TARGET_UPDATE, (1+8+1+8));
|
||||
WorldPacket data(MSG_RAID_TARGET_UPDATE, (1 + 8 + 1 + 8));
|
||||
data << uint8(0); // set targets
|
||||
data << uint64(whoGuid);
|
||||
data << uint8(id);
|
||||
@@ -1521,7 +1522,7 @@ void Group::SendTargetIconList(WorldSession* session)
|
||||
if (!session)
|
||||
return;
|
||||
|
||||
WorldPacket data(MSG_RAID_TARGET_UPDATE, (1+TARGETICONCOUNT*9));
|
||||
WorldPacket data(MSG_RAID_TARGET_UPDATE, (1 + TARGETICONCOUNT * 9));
|
||||
data << uint8(1); // list targets
|
||||
|
||||
for (uint8 i = 0; i < TARGETICONCOUNT; ++i)
|
||||
@@ -1560,7 +1561,7 @@ void Group::SendUpdateToPlayer(uint64 playerGUID, MemberSlot* slot)
|
||||
slot = &(*witr);
|
||||
}
|
||||
|
||||
WorldPacket data(SMSG_GROUP_LIST, (1+1+1+1+1+4+8+4+4+(GetMembersCount()-1)*(13+8+1+1+1+1)+8+1+8+1+1+1+1));
|
||||
WorldPacket data(SMSG_GROUP_LIST, (1 + 1 + 1 + 1 + 1 + 4 + 8 + 4 + 4 + (GetMembersCount() - 1) * (13 + 8 + 1 + 1 + 1 + 1) + 8 + 1 + 8 + 1 + 1 + 1 + 1));
|
||||
data << uint8(m_groupType); // group type (flags in 3.3)
|
||||
data << uint8(slot->group);
|
||||
data << uint8(slot->flags);
|
||||
@@ -1573,7 +1574,7 @@ void Group::SendUpdateToPlayer(uint64 playerGUID, MemberSlot* slot)
|
||||
|
||||
data << uint64(m_guid);
|
||||
data << uint32(m_counter++); // 3.3, value increases every time this packet gets sent
|
||||
data << uint32(GetMembersCount()-1);
|
||||
data << uint32(GetMembersCount() - 1);
|
||||
for (member_citerator citr = m_memberSlots.begin(); citr != m_memberSlots.end(); ++citr)
|
||||
{
|
||||
if (slot->guid == citr->guid)
|
||||
@@ -2074,7 +2075,7 @@ void Group::SetLfgRoles(uint64 guid, const uint8 roles)
|
||||
return;
|
||||
|
||||
slot->roles = roles;
|
||||
SendUpdate();
|
||||
SendUpdate();
|
||||
}
|
||||
|
||||
bool Group::IsFull() const
|
||||
@@ -2122,7 +2123,7 @@ uint32 Group::GetLowGUID() const
|
||||
return GUID_LOPART(m_guid);
|
||||
}
|
||||
|
||||
const char * Group::GetLeaderName() const
|
||||
const char* Group::GetLeaderName() const
|
||||
{
|
||||
return m_leaderName.c_str();
|
||||
}
|
||||
@@ -2177,7 +2178,7 @@ bool Group::SameSubGroup(uint64 guid1, uint64 guid2) const
|
||||
{
|
||||
member_citerator mslot2 = _getMemberCSlot(guid2);
|
||||
if (mslot2 == m_memberSlots.end())
|
||||
return false;
|
||||
return false;
|
||||
return SameSubGroup(guid1, &*mslot2);
|
||||
}
|
||||
|
||||
@@ -2198,7 +2199,7 @@ uint8 Group::GetMemberGroup(uint64 guid) const
|
||||
{
|
||||
member_citerator mslot = _getMemberCSlot(guid);
|
||||
if (mslot == m_memberSlots.end())
|
||||
return (MAX_RAID_SUBGROUPS+1);
|
||||
return (MAX_RAID_SUBGROUPS + 1);
|
||||
return mslot->group;
|
||||
}
|
||||
|
||||
@@ -2207,7 +2208,7 @@ void Group::SetBattlegroundGroup(Battleground* bg)
|
||||
m_bgGroup = bg;
|
||||
}
|
||||
|
||||
void Group::SetBattlefieldGroup(Battlefield *bg)
|
||||
void Group::SetBattlefieldGroup(Battlefield* bg)
|
||||
{
|
||||
m_bfGroup = bg;
|
||||
}
|
||||
@@ -2216,7 +2217,7 @@ void Group::SetGroupMemberFlag(uint64 guid, bool apply, GroupMemberFlags flag)
|
||||
{
|
||||
// Assistants, main assistants and main tanks are only available in raid groups
|
||||
if (!isRaidGroup())
|
||||
return;
|
||||
return;
|
||||
|
||||
// Check if player is really in the raid
|
||||
member_witerator slot = _getMemberWSlot(guid);
|
||||
@@ -2224,7 +2225,8 @@ void Group::SetGroupMemberFlag(uint64 guid, bool apply, GroupMemberFlags flag)
|
||||
return;
|
||||
|
||||
// Do flag specific actions, e.g ensure uniqueness
|
||||
switch (flag) {
|
||||
switch (flag)
|
||||
{
|
||||
case MEMBER_FLAG_MAINASSIST:
|
||||
RemoveUniqueGroupMemberFlag(MEMBER_FLAG_MAINASSIST); // Remove main assist flag from current if any.
|
||||
break;
|
||||
@@ -2275,7 +2277,7 @@ bool Group::isRollLootActive() const
|
||||
Group::Rolls::iterator Group::GetRoll(uint64 Guid)
|
||||
{
|
||||
Rolls::iterator iter;
|
||||
for (iter=RollId.begin(); iter != RollId.end(); ++iter)
|
||||
for (iter = RollId.begin(); iter != RollId.end(); ++iter)
|
||||
if ((*iter)->itemGUID == Guid && (*iter)->isValid())
|
||||
return iter;
|
||||
return RollId.end();
|
||||
|
||||
@@ -123,225 +123,225 @@ enum DifficultyPreventionChangeType
|
||||
};
|
||||
|
||||
#define GROUP_UPDATE_FLAGS_COUNT 20
|
||||
// 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19
|
||||
// 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19
|
||||
static const uint8 GroupUpdateLength[GROUP_UPDATE_FLAGS_COUNT] = { 0, 2, 2, 2, 1, 2, 2, 2, 2, 4, 8, 8, 1, 2, 2, 2, 1, 2, 2, 8};
|
||||
|
||||
class Roll : public LootValidatorRef
|
||||
{
|
||||
public:
|
||||
Roll(uint64 _guid, LootItem const& li);
|
||||
~Roll();
|
||||
void setLoot(Loot* pLoot);
|
||||
Loot* getLoot();
|
||||
void targetObjectBuildLink();
|
||||
public:
|
||||
Roll(uint64 _guid, LootItem const& li);
|
||||
~Roll();
|
||||
void setLoot(Loot* pLoot);
|
||||
Loot* getLoot();
|
||||
void targetObjectBuildLink();
|
||||
|
||||
uint64 itemGUID;
|
||||
uint32 itemid;
|
||||
int32 itemRandomPropId;
|
||||
uint32 itemRandomSuffix;
|
||||
uint8 itemCount;
|
||||
typedef std::map<uint64, RollVote> PlayerVote;
|
||||
PlayerVote playerVote; //vote position correspond with player position (in group)
|
||||
uint8 totalPlayersRolling;
|
||||
uint8 totalNeed;
|
||||
uint8 totalGreed;
|
||||
uint8 totalPass;
|
||||
uint8 itemSlot;
|
||||
uint8 rollVoteMask;
|
||||
uint64 itemGUID;
|
||||
uint32 itemid;
|
||||
int32 itemRandomPropId;
|
||||
uint32 itemRandomSuffix;
|
||||
uint8 itemCount;
|
||||
typedef std::map<uint64, RollVote> PlayerVote;
|
||||
PlayerVote playerVote; //vote position correspond with player position (in group)
|
||||
uint8 totalPlayersRolling;
|
||||
uint8 totalNeed;
|
||||
uint8 totalGreed;
|
||||
uint8 totalPass;
|
||||
uint8 itemSlot;
|
||||
uint8 rollVoteMask;
|
||||
};
|
||||
|
||||
/** request member stats checken **/
|
||||
/** todo: uninvite people that not accepted invite **/
|
||||
class Group
|
||||
{
|
||||
public:
|
||||
struct MemberSlot
|
||||
{
|
||||
uint64 guid;
|
||||
std::string name;
|
||||
uint8 group;
|
||||
uint8 flags;
|
||||
uint8 roles;
|
||||
};
|
||||
typedef std::list<MemberSlot> MemberSlotList;
|
||||
typedef MemberSlotList::const_iterator member_citerator;
|
||||
public:
|
||||
struct MemberSlot
|
||||
{
|
||||
uint64 guid;
|
||||
std::string name;
|
||||
uint8 group;
|
||||
uint8 flags;
|
||||
uint8 roles;
|
||||
};
|
||||
typedef std::list<MemberSlot> MemberSlotList;
|
||||
typedef MemberSlotList::const_iterator member_citerator;
|
||||
|
||||
protected:
|
||||
typedef MemberSlotList::iterator member_witerator;
|
||||
typedef std::set<Player*> InvitesList;
|
||||
protected:
|
||||
typedef MemberSlotList::iterator member_witerator;
|
||||
typedef std::set<Player*> InvitesList;
|
||||
|
||||
typedef std::vector<Roll*> Rolls;
|
||||
typedef std::vector<Roll*> Rolls;
|
||||
|
||||
public:
|
||||
Group();
|
||||
~Group();
|
||||
public:
|
||||
Group();
|
||||
~Group();
|
||||
|
||||
// group manipulation methods
|
||||
bool Create(Player* leader);
|
||||
bool LoadGroupFromDB(Field* field);
|
||||
void LoadMemberFromDB(uint32 guidLow, uint8 memberFlags, uint8 subgroup, uint8 roles);
|
||||
bool AddInvite(Player* player);
|
||||
void RemoveInvite(Player* player);
|
||||
void RemoveAllInvites();
|
||||
bool AddLeaderInvite(Player* player);
|
||||
bool AddMember(Player* player);
|
||||
bool RemoveMember(uint64 guid, const RemoveMethod &method = GROUP_REMOVEMETHOD_DEFAULT, uint64 kicker = 0, const char* reason = nullptr);
|
||||
void ChangeLeader(uint64 guid);
|
||||
void SetLootMethod(LootMethod method);
|
||||
void SetLooterGuid(uint64 guid);
|
||||
void SetMasterLooterGuid(uint64 guid);
|
||||
void UpdateLooterGuid(WorldObject* pLootedObject, bool ifneed = false);
|
||||
void SetLootThreshold(ItemQualities threshold);
|
||||
void Disband(bool hideDestroy=false);
|
||||
void SetLfgRoles(uint64 guid, const uint8 roles);
|
||||
// group manipulation methods
|
||||
bool Create(Player* leader);
|
||||
bool LoadGroupFromDB(Field* field);
|
||||
void LoadMemberFromDB(uint32 guidLow, uint8 memberFlags, uint8 subgroup, uint8 roles);
|
||||
bool AddInvite(Player* player);
|
||||
void RemoveInvite(Player* player);
|
||||
void RemoveAllInvites();
|
||||
bool AddLeaderInvite(Player* player);
|
||||
bool AddMember(Player* player);
|
||||
bool RemoveMember(uint64 guid, const RemoveMethod& method = GROUP_REMOVEMETHOD_DEFAULT, uint64 kicker = 0, const char* reason = nullptr);
|
||||
void ChangeLeader(uint64 guid);
|
||||
void SetLootMethod(LootMethod method);
|
||||
void SetLooterGuid(uint64 guid);
|
||||
void SetMasterLooterGuid(uint64 guid);
|
||||
void UpdateLooterGuid(WorldObject* pLootedObject, bool ifneed = false);
|
||||
void SetLootThreshold(ItemQualities threshold);
|
||||
void Disband(bool hideDestroy = false);
|
||||
void SetLfgRoles(uint64 guid, const uint8 roles);
|
||||
|
||||
// properties accessories
|
||||
bool IsFull() const;
|
||||
bool isLFGGroup() const;
|
||||
bool isRaidGroup() const;
|
||||
bool isBFGroup() const;
|
||||
bool isBGGroup() const;
|
||||
bool IsCreated() const;
|
||||
uint64 GetLeaderGUID() const;
|
||||
uint64 GetGUID() const;
|
||||
uint32 GetLowGUID() const;
|
||||
const char * GetLeaderName() const;
|
||||
LootMethod GetLootMethod() const;
|
||||
uint64 GetLooterGuid() const;
|
||||
uint64 GetMasterLooterGuid() const;
|
||||
ItemQualities GetLootThreshold() const;
|
||||
// properties accessories
|
||||
bool IsFull() const;
|
||||
bool isLFGGroup() const;
|
||||
bool isRaidGroup() const;
|
||||
bool isBFGroup() const;
|
||||
bool isBGGroup() const;
|
||||
bool IsCreated() const;
|
||||
uint64 GetLeaderGUID() const;
|
||||
uint64 GetGUID() const;
|
||||
uint32 GetLowGUID() const;
|
||||
const char* GetLeaderName() const;
|
||||
LootMethod GetLootMethod() const;
|
||||
uint64 GetLooterGuid() const;
|
||||
uint64 GetMasterLooterGuid() const;
|
||||
ItemQualities GetLootThreshold() const;
|
||||
|
||||
// member manipulation methods
|
||||
bool IsMember(uint64 guid) const;
|
||||
bool IsLeader(uint64 guid) const;
|
||||
uint64 GetMemberGUID(const std::string& name);
|
||||
bool IsAssistant(uint64 guid) const;
|
||||
// member manipulation methods
|
||||
bool IsMember(uint64 guid) const;
|
||||
bool IsLeader(uint64 guid) const;
|
||||
uint64 GetMemberGUID(const std::string& name);
|
||||
bool IsAssistant(uint64 guid) const;
|
||||
|
||||
Player* GetInvited(uint64 guid) const;
|
||||
Player* GetInvited(const std::string& name) const;
|
||||
Player* GetInvited(uint64 guid) const;
|
||||
Player* GetInvited(const std::string& name) const;
|
||||
|
||||
bool SameSubGroup(uint64 guid1, uint64 guid2) const;
|
||||
bool SameSubGroup(uint64 guid1, MemberSlot const* slot2) const;
|
||||
bool SameSubGroup(Player const* member1, Player const* member2) const;
|
||||
bool HasFreeSlotSubGroup(uint8 subgroup) const;
|
||||
bool SameSubGroup(uint64 guid1, uint64 guid2) const;
|
||||
bool SameSubGroup(uint64 guid1, MemberSlot const* slot2) const;
|
||||
bool SameSubGroup(Player const* member1, Player const* member2) const;
|
||||
bool HasFreeSlotSubGroup(uint8 subgroup) const;
|
||||
|
||||
MemberSlotList const& GetMemberSlots() const { return m_memberSlots; }
|
||||
GroupReference* GetFirstMember() { return m_memberMgr.getFirst(); }
|
||||
GroupReference const* GetFirstMember() const { return m_memberMgr.getFirst(); }
|
||||
uint32 GetMembersCount() const { return m_memberSlots.size(); }
|
||||
MemberSlotList const& GetMemberSlots() const { return m_memberSlots; }
|
||||
GroupReference* GetFirstMember() { return m_memberMgr.getFirst(); }
|
||||
GroupReference const* GetFirstMember() const { return m_memberMgr.getFirst(); }
|
||||
uint32 GetMembersCount() const { return m_memberSlots.size(); }
|
||||
|
||||
uint8 GetMemberGroup(uint64 guid) const;
|
||||
uint8 GetMemberGroup(uint64 guid) const;
|
||||
|
||||
void ConvertToLFG();
|
||||
void ConvertToRaid();
|
||||
void ConvertToLFG();
|
||||
void ConvertToRaid();
|
||||
|
||||
void SetBattlegroundGroup(Battleground* bg);
|
||||
void SetBattlefieldGroup(Battlefield* bf);
|
||||
GroupJoinBattlegroundResult CanJoinBattlegroundQueue(Battleground const* bgTemplate, BattlegroundQueueTypeId bgQueueTypeId, uint32 MinPlayerCount, uint32 MaxPlayerCount, bool isRated, uint32 arenaSlot);
|
||||
void SetBattlegroundGroup(Battleground* bg);
|
||||
void SetBattlefieldGroup(Battlefield* bf);
|
||||
GroupJoinBattlegroundResult CanJoinBattlegroundQueue(Battleground const* bgTemplate, BattlegroundQueueTypeId bgQueueTypeId, uint32 MinPlayerCount, uint32 MaxPlayerCount, bool isRated, uint32 arenaSlot);
|
||||
|
||||
void ChangeMembersGroup(uint64 guid, uint8 group);
|
||||
void SetTargetIcon(uint8 id, uint64 whoGuid, uint64 targetGuid);
|
||||
void SetGroupMemberFlag(uint64 guid, bool apply, GroupMemberFlags flag);
|
||||
void RemoveUniqueGroupMemberFlag(GroupMemberFlags flag);
|
||||
void ChangeMembersGroup(uint64 guid, uint8 group);
|
||||
void SetTargetIcon(uint8 id, uint64 whoGuid, uint64 targetGuid);
|
||||
void SetGroupMemberFlag(uint64 guid, bool apply, GroupMemberFlags flag);
|
||||
void RemoveUniqueGroupMemberFlag(GroupMemberFlags flag);
|
||||
|
||||
Difficulty GetDifficulty(bool isRaid) const;
|
||||
Difficulty GetDungeonDifficulty() const;
|
||||
Difficulty GetRaidDifficulty() const;
|
||||
void SetDungeonDifficulty(Difficulty difficulty);
|
||||
void SetRaidDifficulty(Difficulty difficulty);
|
||||
uint16 InInstance();
|
||||
void ResetInstances(uint8 method, bool isRaid, Player* leader);
|
||||
Difficulty GetDifficulty(bool isRaid) const;
|
||||
Difficulty GetDungeonDifficulty() const;
|
||||
Difficulty GetRaidDifficulty() const;
|
||||
void SetDungeonDifficulty(Difficulty difficulty);
|
||||
void SetRaidDifficulty(Difficulty difficulty);
|
||||
uint16 InInstance();
|
||||
void ResetInstances(uint8 method, bool isRaid, Player* leader);
|
||||
|
||||
// -no description-
|
||||
//void SendInit(WorldSession* session);
|
||||
void SendTargetIconList(WorldSession* session);
|
||||
void SendUpdate();
|
||||
void SendUpdateToPlayer(uint64 playerGUID, MemberSlot* slot = nullptr);
|
||||
void UpdatePlayerOutOfRange(Player* player);
|
||||
// ignore: GUID of player that will be ignored
|
||||
void BroadcastPacket(WorldPacket* packet, bool ignorePlayersInBGRaid, int group=-1, uint64 ignore=0);
|
||||
void BroadcastReadyCheck(WorldPacket* packet);
|
||||
void OfflineReadyCheck();
|
||||
// -no description-
|
||||
//void SendInit(WorldSession* session);
|
||||
void SendTargetIconList(WorldSession* session);
|
||||
void SendUpdate();
|
||||
void SendUpdateToPlayer(uint64 playerGUID, MemberSlot* slot = nullptr);
|
||||
void UpdatePlayerOutOfRange(Player* player);
|
||||
// ignore: GUID of player that will be ignored
|
||||
void BroadcastPacket(WorldPacket* packet, bool ignorePlayersInBGRaid, int group = -1, uint64 ignore = 0);
|
||||
void BroadcastReadyCheck(WorldPacket* packet);
|
||||
void OfflineReadyCheck();
|
||||
|
||||
/*********************************************************/
|
||||
/*** LOOT SYSTEM ***/
|
||||
/*********************************************************/
|
||||
/*********************************************************/
|
||||
/*** LOOT SYSTEM ***/
|
||||
/*********************************************************/
|
||||
|
||||
bool isRollLootActive() const;
|
||||
void SendLootStartRoll(uint32 CountDown, uint32 mapid, const Roll &r);
|
||||
void SendLootStartRollToPlayer(uint32 countDown, uint32 mapId, Player* p, bool canNeed, Roll const& r);
|
||||
void SendLootRoll(uint64 SourceGuid, uint64 TargetGuid, uint8 RollNumber, uint8 RollType, const Roll &r);
|
||||
void SendLootRollWon(uint64 SourceGuid, uint64 TargetGuid, uint8 RollNumber, uint8 RollType, const Roll &r);
|
||||
void SendLootAllPassed(Roll const& roll);
|
||||
void SendLooter(Creature* creature, Player* pLooter);
|
||||
void GroupLoot(Loot* loot, WorldObject* pLootedObject);
|
||||
void NeedBeforeGreed(Loot* loot, WorldObject* pLootedObject);
|
||||
void MasterLoot(Loot* loot, WorldObject* pLootedObject);
|
||||
Rolls::iterator GetRoll(uint64 Guid);
|
||||
void CountTheRoll(Rolls::iterator roll, Map* allowedMap);
|
||||
bool CountRollVote(uint64 playerGUID, uint64 Guid, uint8 Choise);
|
||||
void EndRoll(Loot* loot, Map* allowedMap);
|
||||
bool isRollLootActive() const;
|
||||
void SendLootStartRoll(uint32 CountDown, uint32 mapid, const Roll& r);
|
||||
void SendLootStartRollToPlayer(uint32 countDown, uint32 mapId, Player* p, bool canNeed, Roll const& r);
|
||||
void SendLootRoll(uint64 SourceGuid, uint64 TargetGuid, uint8 RollNumber, uint8 RollType, const Roll& r);
|
||||
void SendLootRollWon(uint64 SourceGuid, uint64 TargetGuid, uint8 RollNumber, uint8 RollType, const Roll& r);
|
||||
void SendLootAllPassed(Roll const& roll);
|
||||
void SendLooter(Creature* creature, Player* pLooter);
|
||||
void GroupLoot(Loot* loot, WorldObject* pLootedObject);
|
||||
void NeedBeforeGreed(Loot* loot, WorldObject* pLootedObject);
|
||||
void MasterLoot(Loot* loot, WorldObject* pLootedObject);
|
||||
Rolls::iterator GetRoll(uint64 Guid);
|
||||
void CountTheRoll(Rolls::iterator roll, Map* allowedMap);
|
||||
bool CountRollVote(uint64 playerGUID, uint64 Guid, uint8 Choise);
|
||||
void EndRoll(Loot* loot, Map* allowedMap);
|
||||
|
||||
// related to disenchant rolls
|
||||
void ResetMaxEnchantingLevel();
|
||||
// related to disenchant rolls
|
||||
void ResetMaxEnchantingLevel();
|
||||
|
||||
void LinkMember(GroupReference* pRef);
|
||||
void LinkMember(GroupReference* pRef);
|
||||
|
||||
// FG: evil hacks
|
||||
void BroadcastGroupUpdate(void);
|
||||
// FG: evil hacks
|
||||
void BroadcastGroupUpdate(void);
|
||||
|
||||
// LFG
|
||||
void AddLfgBuffFlag() { m_lfgGroupFlags |= GROUP_LFG_FLAG_APPLY_RANDOM_BUFF; }
|
||||
void AddLfgRandomInstanceFlag() { m_lfgGroupFlags |= GROUP_LFG_FLAG_IS_RANDOM_INSTANCE; }
|
||||
void AddLfgHeroicFlag() { m_lfgGroupFlags |= GROUP_LFG_FLAG_IS_HEROIC; }
|
||||
bool IsLfgWithBuff() const { return isLFGGroup() && (m_lfgGroupFlags & GROUP_LFG_FLAG_APPLY_RANDOM_BUFF); }
|
||||
bool IsLfgRandomInstance() const { return isLFGGroup() && (m_lfgGroupFlags & GROUP_LFG_FLAG_IS_RANDOM_INSTANCE); }
|
||||
bool IsLfgHeroic() const { return isLFGGroup() && (m_lfgGroupFlags & GROUP_LFG_FLAG_IS_HEROIC); }
|
||||
// LFG
|
||||
void AddLfgBuffFlag() { m_lfgGroupFlags |= GROUP_LFG_FLAG_APPLY_RANDOM_BUFF; }
|
||||
void AddLfgRandomInstanceFlag() { m_lfgGroupFlags |= GROUP_LFG_FLAG_IS_RANDOM_INSTANCE; }
|
||||
void AddLfgHeroicFlag() { m_lfgGroupFlags |= GROUP_LFG_FLAG_IS_HEROIC; }
|
||||
bool IsLfgWithBuff() const { return isLFGGroup() && (m_lfgGroupFlags & GROUP_LFG_FLAG_APPLY_RANDOM_BUFF); }
|
||||
bool IsLfgRandomInstance() const { return isLFGGroup() && (m_lfgGroupFlags & GROUP_LFG_FLAG_IS_RANDOM_INSTANCE); }
|
||||
bool IsLfgHeroic() const { return isLFGGroup() && (m_lfgGroupFlags & GROUP_LFG_FLAG_IS_HEROIC); }
|
||||
|
||||
// Difficulty Change
|
||||
uint32 GetDifficultyChangePreventionTime() const { return _difficultyChangePreventionTime > time(nullptr) ? _difficultyChangePreventionTime - time(nullptr) : 0; }
|
||||
DifficultyPreventionChangeType GetDifficultyChangePreventionReason() const { return _difficultyChangePreventionType; }
|
||||
void SetDifficultyChangePrevention(DifficultyPreventionChangeType type)
|
||||
{
|
||||
_difficultyChangePreventionTime = time(nullptr) + MINUTE;
|
||||
_difficultyChangePreventionType = type;
|
||||
}
|
||||
// Difficulty Change
|
||||
uint32 GetDifficultyChangePreventionTime() const { return _difficultyChangePreventionTime > time(nullptr) ? _difficultyChangePreventionTime - time(nullptr) : 0; }
|
||||
DifficultyPreventionChangeType GetDifficultyChangePreventionReason() const { return _difficultyChangePreventionType; }
|
||||
void SetDifficultyChangePrevention(DifficultyPreventionChangeType type)
|
||||
{
|
||||
_difficultyChangePreventionTime = time(nullptr) + MINUTE;
|
||||
_difficultyChangePreventionType = type;
|
||||
}
|
||||
|
||||
protected:
|
||||
void _homebindIfInstance(Player* player);
|
||||
void _cancelHomebindIfInstance(Player* player);
|
||||
protected:
|
||||
void _homebindIfInstance(Player* player);
|
||||
void _cancelHomebindIfInstance(Player* player);
|
||||
|
||||
void _initRaidSubGroupsCounter();
|
||||
member_citerator _getMemberCSlot(uint64 Guid) const;
|
||||
member_witerator _getMemberWSlot(uint64 Guid);
|
||||
void SubGroupCounterIncrease(uint8 subgroup);
|
||||
void SubGroupCounterDecrease(uint8 subgroup);
|
||||
void ToggleGroupMemberFlag(member_witerator slot, uint8 flag, bool apply);
|
||||
void _initRaidSubGroupsCounter();
|
||||
member_citerator _getMemberCSlot(uint64 Guid) const;
|
||||
member_witerator _getMemberWSlot(uint64 Guid);
|
||||
void SubGroupCounterIncrease(uint8 subgroup);
|
||||
void SubGroupCounterDecrease(uint8 subgroup);
|
||||
void ToggleGroupMemberFlag(member_witerator slot, uint8 flag, bool apply);
|
||||
|
||||
MemberSlotList m_memberSlots;
|
||||
GroupRefManager m_memberMgr;
|
||||
InvitesList m_invitees;
|
||||
uint64 m_leaderGuid;
|
||||
std::string m_leaderName;
|
||||
GroupType m_groupType;
|
||||
Difficulty m_dungeonDifficulty;
|
||||
Difficulty m_raidDifficulty;
|
||||
Battlefield* m_bfGroup;
|
||||
Battleground* m_bgGroup;
|
||||
uint64 m_targetIcons[TARGETICONCOUNT];
|
||||
LootMethod m_lootMethod;
|
||||
ItemQualities m_lootThreshold;
|
||||
uint64 m_looterGuid;
|
||||
uint64 m_masterLooterGuid;
|
||||
Rolls RollId;
|
||||
uint8* m_subGroupsCounts;
|
||||
uint64 m_guid;
|
||||
uint32 m_counter; // used only in SMSG_GROUP_LIST
|
||||
uint32 m_maxEnchantingLevel;
|
||||
uint8 m_lfgGroupFlags;
|
||||
MemberSlotList m_memberSlots;
|
||||
GroupRefManager m_memberMgr;
|
||||
InvitesList m_invitees;
|
||||
uint64 m_leaderGuid;
|
||||
std::string m_leaderName;
|
||||
GroupType m_groupType;
|
||||
Difficulty m_dungeonDifficulty;
|
||||
Difficulty m_raidDifficulty;
|
||||
Battlefield* m_bfGroup;
|
||||
Battleground* m_bgGroup;
|
||||
uint64 m_targetIcons[TARGETICONCOUNT];
|
||||
LootMethod m_lootMethod;
|
||||
ItemQualities m_lootThreshold;
|
||||
uint64 m_looterGuid;
|
||||
uint64 m_masterLooterGuid;
|
||||
Rolls RollId;
|
||||
uint8* m_subGroupsCounts;
|
||||
uint64 m_guid;
|
||||
uint32 m_counter; // used only in SMSG_GROUP_LIST
|
||||
uint32 m_maxEnchantingLevel;
|
||||
uint8 m_lfgGroupFlags;
|
||||
|
||||
// Xinef: change difficulty prevention
|
||||
uint32 _difficultyChangePreventionTime;
|
||||
DifficultyPreventionChangeType _difficultyChangePreventionType;
|
||||
// Xinef: change difficulty prevention
|
||||
uint32 _difficultyChangePreventionTime;
|
||||
DifficultyPreventionChangeType _difficultyChangePreventionType;
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -35,7 +35,7 @@ void GroupMgr::InitGroupIds()
|
||||
if (result)
|
||||
{
|
||||
uint32 maxId = (*result)[0].GetUInt32();
|
||||
_groupIds.resize(maxId+1);
|
||||
_groupIds.resize(maxId + 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -95,7 +95,7 @@ void GroupMgr::LoadGroups()
|
||||
|
||||
// Delete all groups with less than 2 members
|
||||
CharacterDatabase.DirectExecute("DELETE FROM `groups` WHERE guid NOT IN (SELECT guid FROM group_member GROUP BY guid HAVING COUNT(guid) > 1)");
|
||||
|
||||
|
||||
// Delete invalid lfg_data
|
||||
CharacterDatabase.DirectExecute("DELETE lfg_data FROM lfg_data LEFT JOIN `groups` ON lfg_data.guid = groups.guid WHERE groups.guid IS NULL OR groups.groupType <> 12");
|
||||
// CharacterDatabase.DirectExecute("DELETE `groups` FROM `groups` LEFT JOIN lfg_data ON groups.guid = lfg_data.guid WHERE groups.groupType=12 AND lfg_data.guid IS NULL"); // group should be left so binds are cleared when disbanded
|
||||
@@ -104,8 +104,8 @@ void GroupMgr::LoadGroups()
|
||||
|
||||
// 0 1 2 3 4 5 6 7 8 9
|
||||
QueryResult result = CharacterDatabase.Query("SELECT g.leaderGuid, g.lootMethod, g.looterGuid, g.lootThreshold, g.icon1, g.icon2, g.icon3, g.icon4, g.icon5, g.icon6"
|
||||
// 10 11 12 13 14 15 16 17 18
|
||||
", g.icon7, g.icon8, g.groupType, g.difficulty, g.raidDifficulty, g.masterLooterGuid, g.guid, lfg.dungeon, lfg.state FROM `groups` g LEFT JOIN lfg_data lfg ON lfg.guid = g.guid ORDER BY g.guid ASC");
|
||||
// 10 11 12 13 14 15 16 17 18
|
||||
", g.icon7, g.icon8, g.groupType, g.difficulty, g.raidDifficulty, g.masterLooterGuid, g.guid, lfg.dungeon, lfg.state FROM `groups` g LEFT JOIN lfg_data lfg ON lfg.guid = g.guid ORDER BY g.guid ASC");
|
||||
|
||||
if (!result)
|
||||
{
|
||||
@@ -129,8 +129,7 @@ void GroupMgr::LoadGroups()
|
||||
RegisterGroupId(group->GetLowGUID());
|
||||
|
||||
++count;
|
||||
}
|
||||
while (result->NextRow());
|
||||
} while (result->NextRow());
|
||||
|
||||
sLog->outString(">> Loaded %u group definitions in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
sLog->outString();
|
||||
@@ -167,8 +166,7 @@ void GroupMgr::LoadGroups()
|
||||
// sLog->outError("GroupMgr::LoadGroups: Consistency failed, can't find group (storage id: %u)", fields[0].GetUInt32());
|
||||
|
||||
++count;
|
||||
}
|
||||
while (result->NextRow());
|
||||
} while (result->NextRow());
|
||||
|
||||
sLog->outString(">> Loaded %u group members in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
|
||||
sLog->outString();
|
||||
|
||||
@@ -17,7 +17,7 @@ private:
|
||||
|
||||
public:
|
||||
static GroupMgr* instance();
|
||||
|
||||
|
||||
typedef std::map<uint32, Group*> GroupContainer;
|
||||
|
||||
Group* GetGroupByGUID(uint32 guid) const;
|
||||
|
||||
@@ -15,9 +15,9 @@ class GroupReference;
|
||||
|
||||
class GroupRefManager : public RefManager<Group, Player>
|
||||
{
|
||||
public:
|
||||
GroupReference* getFirst() { return ((GroupReference*)RefManager<Group, Player>::getFirst()); }
|
||||
GroupReference const* getFirst() const { return ((GroupReference const*)RefManager<Group, Player>::getFirst()); }
|
||||
public:
|
||||
GroupReference* getFirst() { return ((GroupReference*)RefManager<Group, Player>::getFirst()); }
|
||||
GroupReference const* getFirst() const { return ((GroupReference const*)RefManager<Group, Player>::getFirst()); }
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
@@ -14,18 +14,18 @@ class Player;
|
||||
|
||||
class GroupReference : public Reference<Group, Player>
|
||||
{
|
||||
protected:
|
||||
uint8 iSubGroup;
|
||||
void targetObjectBuildLink();
|
||||
void targetObjectDestroyLink();
|
||||
void sourceObjectDestroyLink();
|
||||
public:
|
||||
GroupReference() : Reference<Group, Player>(), iSubGroup(0) {}
|
||||
~GroupReference() { unlink(); }
|
||||
GroupReference* next() { return (GroupReference*)Reference<Group, Player>::next(); }
|
||||
GroupReference const* next() const { return (GroupReference const*)Reference<Group, Player>::next(); }
|
||||
uint8 getSubGroup() const { return iSubGroup; }
|
||||
void setSubGroup(uint8 pSubGroup) { iSubGroup = pSubGroup; }
|
||||
protected:
|
||||
uint8 iSubGroup;
|
||||
void targetObjectBuildLink();
|
||||
void targetObjectDestroyLink();
|
||||
void sourceObjectDestroyLink();
|
||||
public:
|
||||
GroupReference() : Reference<Group, Player>(), iSubGroup(0) {}
|
||||
~GroupReference() { unlink(); }
|
||||
GroupReference* next() { return (GroupReference*)Reference<Group, Player>::next(); }
|
||||
GroupReference const* next() const { return (GroupReference const*)Reference<Group, Player>::next(); }
|
||||
uint8 getSubGroup() const { return iSubGroup; }
|
||||
void setSubGroup(uint8 pSubGroup) { iSubGroup = pSubGroup; }
|
||||
};
|
||||
#endif
|
||||
|
||||
|
||||
Reference in New Issue
Block a user