[7730] Some optimizantion and code style. Author: zhenya

--HG--
branch : trunk
This commit is contained in:
megamage
2009-04-29 00:26:07 -05:00
parent 9dd4b8c985
commit de11b9e901
60 changed files with 264 additions and 264 deletions
+8 -8
View File
@@ -1754,7 +1754,7 @@ class TRINITY_DLL_SPEC Player : public Unit
bool InBattleGroundQueue() const
{
for (int i=0; i < PLAYER_MAX_BATTLEGROUND_QUEUES; i++)
for (int i=0; i < PLAYER_MAX_BATTLEGROUND_QUEUES; ++i)
if (m_bgBattleGroundQueueID[i].bgQueueTypeId != BATTLEGROUND_QUEUE_NONE)
return true;
return false;
@@ -1763,14 +1763,14 @@ class TRINITY_DLL_SPEC Player : public Unit
BattleGroundQueueTypeId GetBattleGroundQueueTypeId(uint32 index) const { return m_bgBattleGroundQueueID[index].bgQueueTypeId; }
uint32 GetBattleGroundQueueIndex(BattleGroundQueueTypeId bgQueueTypeId) const
{
for (int i=0; i < PLAYER_MAX_BATTLEGROUND_QUEUES; i++)
for (int i=0; i < PLAYER_MAX_BATTLEGROUND_QUEUES; ++i)
if (m_bgBattleGroundQueueID[i].bgQueueTypeId == bgQueueTypeId)
return i;
return PLAYER_MAX_BATTLEGROUND_QUEUES;
}
bool IsInvitedForBattleGroundQueueType(BattleGroundQueueTypeId bgQueueTypeId) const
{
for (int i=0; i < PLAYER_MAX_BATTLEGROUND_QUEUES; i++)
for (int i=0; i < PLAYER_MAX_BATTLEGROUND_QUEUES; ++i)
if (m_bgBattleGroundQueueID[i].bgQueueTypeId == bgQueueTypeId)
return m_bgBattleGroundQueueID[i].invitedToInstance != 0;
return false;
@@ -1787,7 +1787,7 @@ class TRINITY_DLL_SPEC Player : public Unit
}
uint32 AddBattleGroundQueueId(BattleGroundQueueTypeId val)
{
for (int i=0; i < PLAYER_MAX_BATTLEGROUND_QUEUES; i++)
for (int i=0; i < PLAYER_MAX_BATTLEGROUND_QUEUES; ++i)
{
if (m_bgBattleGroundQueueID[i].bgQueueTypeId == BATTLEGROUND_QUEUE_NONE || m_bgBattleGroundQueueID[i].bgQueueTypeId == val)
{
@@ -1800,14 +1800,14 @@ class TRINITY_DLL_SPEC Player : public Unit
}
bool HasFreeBattleGroundQueueId()
{
for (int i=0; i < PLAYER_MAX_BATTLEGROUND_QUEUES; i++)
for (int i=0; i < PLAYER_MAX_BATTLEGROUND_QUEUES; ++i)
if (m_bgBattleGroundQueueID[i].bgQueueTypeId == BATTLEGROUND_QUEUE_NONE)
return true;
return false;
}
void RemoveBattleGroundQueueId(BattleGroundQueueTypeId val)
{
for (int i=0; i < PLAYER_MAX_BATTLEGROUND_QUEUES; i++)
for (int i=0; i < PLAYER_MAX_BATTLEGROUND_QUEUES; ++i)
{
if (m_bgBattleGroundQueueID[i].bgQueueTypeId == val)
{
@@ -1819,13 +1819,13 @@ class TRINITY_DLL_SPEC Player : public Unit
}
void SetInviteForBattleGroundQueueType(BattleGroundQueueTypeId bgQueueTypeId, uint32 instanceId)
{
for (int i=0; i < PLAYER_MAX_BATTLEGROUND_QUEUES; i++)
for (int i=0; i < PLAYER_MAX_BATTLEGROUND_QUEUES; ++i)
if (m_bgBattleGroundQueueID[i].bgQueueTypeId == bgQueueTypeId)
m_bgBattleGroundQueueID[i].invitedToInstance = instanceId;
}
bool IsInvitedForBattleGroundInstance(uint32 instanceId) const
{
for (int i=0; i < PLAYER_MAX_BATTLEGROUND_QUEUES; i++)
for (int i=0; i < PLAYER_MAX_BATTLEGROUND_QUEUES; ++i)
if (m_bgBattleGroundQueueID[i].invitedToInstance == instanceId)
return true;
return false;