TrinityCore
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Ticket Class Referenceabstract

#include <SupportMgr.h>

Public Member Functions

 Ticket ()
 
 Ticket (Player *player)
 
virtual ~Ticket ()
 
bool IsClosed () const
 
bool IsFromPlayer (ObjectGuid guid) const
 
bool IsAssigned () const
 
bool IsAssignedTo (ObjectGuid guid) const
 
bool IsAssignedNotTo (ObjectGuid guid) const
 
uint32 GetId () const
 
ObjectGuid GetPlayerGuid () const
 
PlayerGetPlayer () const
 
std::string GetPlayerName () const
 
PlayerGetAssignedPlayer () const
 
ObjectGuid GetAssignedToGUID () const
 
std::string GetAssignedToName () const
 
std::string constGetComment () const
 
virtual void SetAssignedTo (ObjectGuid guid, bool=false)
 
virtual void SetUnassigned ()
 
void SetClosedBy (ObjectGuid value)
 
void SetComment (std::string const &comment)
 
void SetPosition (uint32 mapId, G3D::Vector3 &pos)
 
virtual void LoadFromDB (Field *fields)=0
 
virtual void SaveToDB () const =0
 
virtual void DeleteFromDB ()=0
 
void TeleportTo (Player *player) const
 
virtual std::string FormatViewMessageString (ChatHandler &handler, bool detailed=false) const =0
 
virtual std::string FormatViewMessageString (ChatHandler &handler, const char *szClosedName, const char *szAssignedToName, const char *szUnassignedName, const char *szDeletedName) const
 

Protected Attributes

uint32 _id
 
ObjectGuid _playerGuid
 
uint16 _mapId
 
G3D::Vector3 _pos
 
uint64 _createTime
 
ObjectGuid _closedBy
 
ObjectGuid _assignedTo
 
std::string _comment
 

Constructor & Destructor Documentation

Ticket::Ticket ( )
24 : _id(0), _mapId(0), _createTime(0) { }
uint32 _id
Definition: SupportMgr.h:109
uint64 _createTime
Definition: SupportMgr.h:113
uint16 _mapId
Definition: SupportMgr.h:111
Ticket::Ticket ( Player player)
26  : _id(0), _mapId(0), _createTime(time(nullptr))
27 {
28  _playerGuid = player->GetGUID();
29 }
uint32 _id
Definition: SupportMgr.h:109
uint64 _createTime
Definition: SupportMgr.h:113
uint16 _mapId
Definition: SupportMgr.h:111
ObjectGuid _playerGuid
Definition: SupportMgr.h:110
Ticket::~Ticket ( )
virtual
31 { }

Member Function Documentation

virtual void Ticket::DeleteFromDB ( )
pure virtual
virtual std::string Ticket::FormatViewMessageString ( ChatHandler handler,
bool  detailed = false 
) const
pure virtual
std::string Ticket::FormatViewMessageString ( ChatHandler handler,
const char *  szClosedName,
const char *  szAssignedToName,
const char *  szUnassignedName,
const char *  szDeletedName 
) const
virtual
39 {
40  std::stringstream ss;
43  if (closedName)
44  ss << handler.PGetParseString(LANG_COMMAND_TICKETCLOSED, closedName);
45  if (assignedToName)
46  ss << handler.PGetParseString(LANG_COMMAND_TICKETLISTASSIGNEDTO, assignedToName);
47  if (unassignedName)
48  ss << handler.PGetParseString(LANG_COMMAND_TICKETLISTUNASSIGNED, unassignedName);
49  if (deletedName)
50  ss << handler.PGetParseString(LANG_COMMAND_TICKETDELETED, deletedName);
51  return ss.str();
52 }
Definition: Language.h:1054
uint32 _id
Definition: SupportMgr.h:109
std::string PGetParseString(uint32 entry, Args &&...args) const
Definition: Chat.h:84
Definition: Language.h:1042
Definition: Language.h:1056
std::string GetPlayerName() const
Definition: SupportMgr.h:69
Definition: Language.h:1041
Definition: Language.h:1055
Definition: Language.h:1053

+ Here is the call graph for this function:

Player* Ticket::GetAssignedPlayer ( ) const
inline
ObjectGuid _assignedTo
Definition: SupportMgr.h:115
TC_GAME_API Player * FindConnectedPlayer(ObjectGuid const &)
Definition: ObjectAccessor.cpp:215

+ Here is the call graph for this function:

ObjectGuid Ticket::GetAssignedToGUID ( ) const
inline
78 { return _assignedTo; }
ObjectGuid _assignedTo
Definition: SupportMgr.h:115
std::string Ticket::GetAssignedToName ( ) const
inline
80  {
81  std::string name;
82  if (!_assignedTo.IsEmpty())
84 
85  return name;
86  }
ObjectGuid _assignedTo
Definition: SupportMgr.h:115
static bool GetPlayerNameByGUID(ObjectGuid const &guid, std::string &name)
Definition: ObjectMgr.cpp:2258
bool IsEmpty() const
Definition: ObjectGuid.h:242

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::string const& Ticket::GetComment ( ) const
inline
87 { return _comment; }
std::string _comment
Definition: SupportMgr.h:116
uint32 Ticket::GetId ( void  ) const
inline
66 { return _id; }
uint32 _id
Definition: SupportMgr.h:109

+ Here is the caller graph for this function:

Player* Ticket::GetPlayer ( ) const
inline
ObjectGuid _playerGuid
Definition: SupportMgr.h:110
TC_GAME_API Player * FindConnectedPlayer(ObjectGuid const &)
Definition: ObjectAccessor.cpp:215

+ Here is the call graph for this function:

ObjectGuid Ticket::GetPlayerGuid ( ) const
inline
67 { return _playerGuid; }
ObjectGuid _playerGuid
Definition: SupportMgr.h:110
std::string Ticket::GetPlayerName ( ) const
inline
70  {
71  std::string name;
72  if (!_playerGuid.IsEmpty())
74 
75  return name;
76  }
ObjectGuid _playerGuid
Definition: SupportMgr.h:110
static bool GetPlayerNameByGUID(ObjectGuid const &guid, std::string &name)
Definition: ObjectMgr.cpp:2258
bool IsEmpty() const
Definition: ObjectGuid.h:242

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool Ticket::IsAssigned ( ) const
inline
62 { return !_assignedTo.IsEmpty(); }
ObjectGuid _assignedTo
Definition: SupportMgr.h:115
bool IsEmpty() const
Definition: ObjectGuid.h:242
bool Ticket::IsAssignedNotTo ( ObjectGuid  guid) const
inline
64 { return IsAssigned() && !IsAssignedTo(guid); }
bool IsAssignedTo(ObjectGuid guid) const
Definition: SupportMgr.h:63
bool IsAssigned() const
Definition: SupportMgr.h:62
bool Ticket::IsAssignedTo ( ObjectGuid  guid) const
inline
63 { return guid == _assignedTo; }
ObjectGuid _assignedTo
Definition: SupportMgr.h:115
bool Ticket::IsClosed ( ) const
inline
60 { return !_closedBy.IsEmpty(); }
ObjectGuid _closedBy
Definition: SupportMgr.h:114
bool IsEmpty() const
Definition: ObjectGuid.h:242

+ Here is the caller graph for this function:

bool Ticket::IsFromPlayer ( ObjectGuid  guid) const
inline
61 { return guid == _playerGuid; }
ObjectGuid _playerGuid
Definition: SupportMgr.h:110
virtual void Ticket::LoadFromDB ( Field fields)
pure virtual
virtual void Ticket::SaveToDB ( ) const
pure virtual
virtual void Ticket::SetAssignedTo ( ObjectGuid  guid,
bool  = false 
)
inlinevirtual
89 { _assignedTo = guid; }
ObjectGuid _assignedTo
Definition: SupportMgr.h:115
void Ticket::SetClosedBy ( ObjectGuid  value)
inline
91 { _closedBy = value; }
ObjectGuid _closedBy
Definition: SupportMgr.h:114
const FieldDescriptor value
Definition: descriptor.h:1522
void Ticket::SetComment ( std::string const comment)
inline
92 { _comment = comment; }
std::string _comment
Definition: SupportMgr.h:116
void Ticket::SetPosition ( uint32  mapId,
G3D::Vector3 pos 
)
inline
94  {
95  _mapId = mapId;
96  _pos = pos;
97  }
uint16 _mapId
Definition: SupportMgr.h:111
G3D::Vector3 _pos
Definition: SupportMgr.h:112

+ Here is the caller graph for this function:

virtual void Ticket::SetUnassigned ( )
inlinevirtual
90 { _assignedTo.Clear(); }
ObjectGuid _assignedTo
Definition: SupportMgr.h:115
void Clear()
Definition: ObjectGuid.h:215
void Ticket::TeleportTo ( Player player) const
34 {
35  player->TeleportTo(_mapId, _pos.x, _pos.y, _pos.z, 0.0f, 0);
36 }
float x
Definition: Vector3.h:62
float y
Definition: Vector3.h:62
uint16 _mapId
Definition: SupportMgr.h:111
float z
Definition: Vector3.h:62
G3D::Vector3 _pos
Definition: SupportMgr.h:112

Member Data Documentation

ObjectGuid Ticket::_assignedTo
protected
ObjectGuid Ticket::_closedBy
protected
std::string Ticket::_comment
protected
uint64 Ticket::_createTime
protected
uint32 Ticket::_id
protected
uint16 Ticket::_mapId
protected
ObjectGuid Ticket::_playerGuid
protected
G3D::Vector3 Ticket::_pos
protected

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