TrinityCore
LootRoll Class Reference

#include <Loot.h>

Public Types

using RollVoteMap = std::unordered_map< ObjectGuid, PlayerRollVote >
 

Public Member Functions

 LootRoll ()
 
 ~LootRoll ()
 
 LootRoll (LootRoll const &)=delete
 
 LootRoll (LootRoll &&)=delete
 
LootRolloperator= (LootRoll const &)=delete
 
LootRolloperator= (LootRoll &&)=delete
 
bool TryToStart (Map *map, Loot &loot, uint32 lootListId, uint16 enchantingSkill)
 
bool PlayerVote (Player *player, RollVote vote)
 
bool UpdateRoll ()
 
bool IsLootItem (ObjectGuid const &lootObject, uint32 lootListId) const
 

Private Member Functions

void SendStartRoll ()
 
void SendAllPassed ()
 
void SendRoll (ObjectGuid const &targetGuid, int32 rollNumber, RollVote rollType, Optional< ObjectGuid > const &rollWinner)
 
void SendLootRollWon (ObjectGuid const &targetGuid, int32 rollNumber, RollVote rollType)
 
void FillPacket (WorldPackets::Loot::LootItemData &lootItem) const
 
void Finish (RollVoteMap::const_iterator winnerItr)
 
bool AllPlayerVoted (RollVoteMap::const_iterator &winnerItr)
 Check if all player have voted and return true in that case. Also return current winner. More...
 
ItemDisenchantLootEntry const * GetItemDisenchantLoot () const
 

Private Attributes

Mapm_map
 
RollVoteMap m_rollVoteMap
 
bool m_isStarted
 
LootItemm_lootItem
 
Lootm_loot
 
RollMask m_voteMask
 
TimePoint m_endTime
 

Detailed Description

Definition at line 243 of file Loot.h.

Member Typedef Documentation

◆ RollVoteMap

using LootRoll::RollVoteMap = std::unordered_map<ObjectGuid, PlayerRollVote>

Definition at line 246 of file Loot.h.

Constructor & Destructor Documentation

◆ LootRoll() [1/3]

LootRoll::LootRoll ( )
inline

Definition at line 248 of file Loot.h.

◆ ~LootRoll()

LootRoll::~LootRoll ( )

Definition at line 379 of file Loot.cpp.

+ Here is the call graph for this function:

◆ LootRoll() [2/3]

LootRoll::LootRoll ( LootRoll const &  )
delete

◆ LootRoll() [3/3]

LootRoll::LootRoll ( LootRoll &&  )
delete

Member Function Documentation

◆ AllPlayerVoted()

bool LootRoll::AllPlayerVoted ( RollVoteMap::const_iterator &  winnerItr)
private

Check if all player have voted and return true in that case. Also return current winner.

Parameters
winnerItr> will be different than m_rollCoteMap.end() if winner exist. (Someone voted greed or need)
Returns
true if all players voted

Definition at line 521 of file Loot.cpp.

+ Here is the caller graph for this function:

◆ FillPacket()

void LootRoll::FillPacket ( WorldPackets::Loot::LootItemData lootItem) const
private

Definition at line 371 of file Loot.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ Finish()

void LootRoll::Finish ( RollVoteMap::const_iterator  winnerItr)
private

Definition at line 576 of file Loot.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ GetItemDisenchantLoot()

ItemDisenchantLootEntry const * LootRoll::GetItemDisenchantLoot ( ) const
private

Definition at line 560 of file Loot.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsLootItem()

bool LootRoll::IsLootItem ( ObjectGuid const &  lootObject,
uint32  lootListId 
) const

Definition at line 511 of file Loot.cpp.

+ Here is the call graph for this function:

◆ operator=() [1/2]

LootRoll & LootRoll::operator= ( LootRoll &&  )
delete

◆ operator=() [2/2]

LootRoll & LootRoll::operator= ( LootRoll const &  )
delete

◆ PlayerVote()

bool LootRoll::PlayerVote ( Player player,
RollVote  vote 
)

Definition at line 455 of file Loot.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SendAllPassed()

void LootRoll::SendAllPassed ( )
private

Definition at line 255 of file Loot.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SendLootRollWon()

void LootRoll::SendLootRollWon ( ObjectGuid const &  targetGuid,
int32  rollNumber,
RollVote  rollType 
)
private

Definition at line 318 of file Loot.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SendRoll()

void LootRoll::SendRoll ( ObjectGuid const &  targetGuid,
int32  rollNumber,
RollVote  rollType,
Optional< ObjectGuid > const &  rollWinner 
)
private

Definition at line 278 of file Loot.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ SendStartRoll()

void LootRoll::SendStartRoll ( )
private

Definition at line 215 of file Loot.cpp.

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ TryToStart()

bool LootRoll::TryToStart ( Map map,
Loot loot,
uint32  lootListId,
uint16  enchantingSkill 
)

Definition at line 399 of file Loot.cpp.

+ Here is the call graph for this function:

◆ UpdateRoll()

bool LootRoll::UpdateRoll ( )

Definition at line 499 of file Loot.cpp.

+ Here is the call graph for this function:

Member Data Documentation

◆ m_endTime

TimePoint LootRoll::m_endTime
private

Definition at line 277 of file Loot.h.

◆ m_isStarted

bool LootRoll::m_isStarted
private

Definition at line 273 of file Loot.h.

◆ m_loot

Loot* LootRoll::m_loot
private

Definition at line 275 of file Loot.h.

◆ m_lootItem

LootItem* LootRoll::m_lootItem
private

Definition at line 274 of file Loot.h.

◆ m_map

Map* LootRoll::m_map
private

Definition at line 271 of file Loot.h.

◆ m_rollVoteMap

RollVoteMap LootRoll::m_rollVoteMap
private

Definition at line 272 of file Loot.h.

◆ m_voteMask

RollMask LootRoll::m_voteMask
private

Definition at line 276 of file Loot.h.


The documentation for this class was generated from the following files: