Changeset 132 for trunk/src/game/Group.h
- Timestamp:
- 11/19/08 13:39:06 (17 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/game/Group.h
r111 r132 184 184 185 185 // member manipulation methods 186 bool IsMember( uint64guid) const { return _getMemberCSlot(guid) != m_memberSlots.end(); }187 bool IsLeader(uint64guid) const { return (GetLeaderGUID() == guid); }186 bool IsMember(const uint64& guid) const { return _getMemberCSlot(guid) != m_memberSlots.end(); } 187 bool IsLeader(const uint64& guid) const { return (GetLeaderGUID() == guid); } 188 188 bool IsAssistant(uint64 guid) const 189 189 { … … 195 195 } 196 196 197 bool SameSubGroup(uint64 guid1, uint64guid2) const197 bool SameSubGroup(uint64 guid1,const uint64& guid2) const 198 198 { 199 199 member_citerator mslot2 = _getMemberCSlot(guid2); … … 212 212 return (mslot1->group==slot2->group); 213 213 } 214 215 bool HasFreeSlotSubGroup(uint8 subgroup) const 216 { 217 return (m_subGroupsCounts && m_subGroupsCounts[subgroup] < MAXGROUPSIZE); 218 } 214 219 215 220 bool SameSubGroup(Player const* member1, Player const* member2) const; … … 229 234 230 235 // some additional raid methods 231 void ConvertToRaid() 232 { 233 _convertToRaid(); 234 SendUpdate(); 235 } 236 void ConvertToRaid(); 237 236 238 void SetBattlegroundGroup(BattleGround *bg) { m_bgGroup = bg; } 237 239 uint32 CanJoinBattleGroundQueue(uint32 bgTypeId, uint32 bgQueueType, uint32 MinPlayerCount, uint32 MaxPlayerCount, bool isRated, uint32 arenaSlot); … … 240 242 void ChangeMembersGroup(Player *player, const uint8 &group); 241 243 242 void SetAssistant( const uint64 &guid, const bool &state)244 void SetAssistant(uint64 guid, const bool &state) 243 245 { 244 246 if(!isRaidGroup()) … … 247 249 SendUpdate(); 248 250 } 249 void SetMainTank( const uint64 &guid)251 void SetMainTank(uint64 guid) 250 252 { 251 253 if(!isRaidGroup()) … … 255 257 SendUpdate(); 256 258 } 257 void SetMainAssistant( const uint64 &guid)259 void SetMainAssistant(uint64 guid) 258 260 { 259 261 if(!isRaidGroup()) … … 286 288 287 289 void SendLootStartRoll(uint32 CountDown, const Roll &r); 288 void SendLootRoll( uint64 SourceGuid, uint64TargetGuid, uint8 RollNumber, uint8 RollType, const Roll &r);289 void SendLootRollWon( uint64 SourceGuid, uint64TargetGuid, uint8 RollNumber, uint8 RollType, const Roll &r);290 void SendLootRoll(const uint64& SourceGuid, const uint64& TargetGuid, uint8 RollNumber, uint8 RollType, const Roll &r); 291 void SendLootRollWon(const uint64& SourceGuid, const uint64& TargetGuid, uint8 RollNumber, uint8 RollType, const Roll &r); 290 292 void SendLootAllPassed(uint32 NumberOfPlayers, const Roll &r); 291 void GroupLoot( uint64playerGUID, Loot *loot, Creature *creature);292 void NeedBeforeGreed(uint64playerGUID, Loot *loot, Creature *creature);293 void MasterLoot(uint64playerGUID, Loot *loot, Creature *creature);293 void GroupLoot(const uint64& playerGUID, Loot *loot, Creature *creature); 294 void NeedBeforeGreed(const uint64& playerGUID, Loot *loot, Creature *creature); 295 void MasterLoot(const uint64& playerGUID, Loot *loot, Creature *creature); 294 296 Rolls::iterator GetRoll(uint64 Guid) 295 297 { … … 305 307 } 306 308 void CountTheRoll(Rolls::iterator roll, uint32 NumberOfPlayers); 307 void CountRollVote( uint64 playerGUID, uint64Guid, uint32 NumberOfPlayers, uint8 Choise);309 void CountRollVote(const uint64& playerGUID, const uint64& Guid, uint32 NumberOfPlayers, uint8 Choise); 308 310 void EndRoll(); 309 311 … … 324 326 void _removeRolls(const uint64 &guid); 325 327 326 void _convertToRaid();327 328 bool _setMembersGroup(const uint64 &guid, const uint8 &group); 328 329 bool _setAssistantFlag(const uint64 &guid, const bool &state); … … 331 332 332 333 void _homebindIfInstance(Player *player); 334 335 void _initRaidSubGroupsCounter() 336 { 337 // Sub group counters initialization 338 if (!m_subGroupsCounts) 339 m_subGroupsCounts = new uint8[MAXRAIDSIZE / MAXGROUPSIZE]; 340 341 memset((void*)m_subGroupsCounts, 0, (MAXRAIDSIZE / MAXGROUPSIZE)*sizeof(uint8)); 342 343 for (member_citerator itr = m_memberSlots.begin(); itr != m_memberSlots.end(); ++itr) 344 ++m_subGroupsCounts[itr->group]; 345 } 333 346 334 347 member_citerator _getMemberCSlot(uint64 Guid) const … … 351 364 return m_memberSlots.end(); 352 365 } 366 367 void SubGroupCounterIncrease(uint8 subgroup) 368 { 369 if (m_subGroupsCounts) 370 ++m_subGroupsCounts[subgroup]; 371 } 372 373 void SubGroupCounterDecrease(uint8 subgroup) 374 { 375 if (m_subGroupsCounts) 376 --m_subGroupsCounts[subgroup]; 377 } 353 378 354 379 MemberSlotList m_memberSlots; … … 368 393 Rolls RollId; 369 394 BoundInstancesMap m_boundInstances[TOTAL_DIFFICULTIES]; 395 uint8* m_subGroupsCounts; 370 396 }; 371 397 #endif