Mana
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
Party Class Reference

#include <party.h>

Inheritance diagram for Party:
AvatarListModel

Public Member Functions

void setName (const std::string &name)
 Set the party's name.
 
PartyMemberaddMember (int id, const std::string &name)
 Adds member to the list.
 
PartyMembergetMember (int id) const
 Find a member by ID.
 
PartyMembergetMember (const std::string &name) const
 Find a member by name.
 
const std::string & getName () const
 Get the name of the party.
 
short getId () const
 Get the id of the party.
 
void removeMember (PartyMember *member)
 Removes a member from the party.
 
void removeMember (int id)
 Removes a member from the party.
 
void removeMember (const std::string &name)
 Removes a member from the party.
 
void clearMembers ()
 
void removeFromMembers ()
 
int getNumberOfElements () override
 Get size of members list.
 
AvatargetAvatarAt (int i) override
 
bool getInviteRights () const
 Get whether user can invite users to this party.
 
void setRights (short rights)
 
bool isMember (PartyMember *member) const
 
bool isMember (int id) const
 
bool isMember (const std::string &name) const
 
void getNames (std::vector< std::string > &names) const
 
- Public Member Functions inherited from AvatarListModel
std::string getElementAt (int i) override
 

Static Public Member Functions

static PartygetParty (int id)
 

Private Types

using PartyMap = std::map< int, Party * >
 

Private Member Functions

 Party (short id)
 Constructor with party id passed to it.
 
 ~Party () override
 

Private Attributes

std::vector< PartyMember * > mMembers
 
std::string mName
 
short mId
 
bool mCanInviteUsers = false
 

Static Private Attributes

static PartyMap parties
 

Detailed Description

Definition at line 58 of file party.h.

Member Typedef Documentation

◆ PartyMap

using Party::PartyMap = std::map<int, Party *>
private

Definition at line 158 of file party.h.

Constructor & Destructor Documentation

◆ Party()

Party::Party ( short  id)
private

Constructor with party id passed to it.

Definition at line 34 of file party.cpp.

◆ ~Party()

Party::~Party ( )
overrideprivate

Definition at line 40 of file party.cpp.

Member Function Documentation

◆ addMember()

PartyMember * Party::addMember ( int  id,
const std::string &  name 
)

Adds member to the list.

Definition at line 45 of file party.cpp.

◆ clearMembers()

void Party::clearMembers ( )
inline

Definition at line 122 of file party.h.

◆ getAvatarAt()

Avatar * Party::getAvatarAt ( int  i)
overridevirtual

Implements AvatarListModel.

Definition at line 128 of file party.cpp.

◆ getId()

short Party::getId ( ) const
inline

Get the id of the party.

Returns
Returns the id of the party

Definition at line 102 of file party.h.

◆ getInviteRights()

bool Party::getInviteRights ( ) const
inline

Get whether user can invite users to this party.

Returns
Returns true if user can invite users

Definition at line 140 of file party.h.

◆ getMember() [1/2]

PartyMember * Party::getMember ( const std::string &  name) const

Find a member by name.

Returns
the member with the given name, or NULL if they don't exist.

Definition at line 69 of file party.cpp.

◆ getMember() [2/2]

PartyMember * Party::getMember ( int  id) const

Find a member by ID.

Returns
the member with the given ID, or NULL if they don't exist.

Definition at line 60 of file party.cpp.

◆ getName()

const std::string & Party::getName ( ) const
inline

Get the name of the party.

Returns
returns name of the party

Definition at line 93 of file party.h.

◆ getNames()

void Party::getNames ( std::vector< std::string > &  names) const

Definition at line 178 of file party.cpp.

◆ getNumberOfElements()

int Party::getNumberOfElements ( )
inlineoverride

Get size of members list.

Returns
Returns the number of members in the party.

Definition at line 130 of file party.h.

◆ getParty()

Party * Party::getParty ( int  id)
static

Definition at line 185 of file party.cpp.

◆ isMember() [1/3]

bool Party::isMember ( const std::string &  name) const

Definition at line 169 of file party.cpp.

◆ isMember() [2/3]

bool Party::isMember ( int  id) const

Definition at line 160 of file party.cpp.

◆ isMember() [3/3]

bool Party::isMember ( PartyMember member) const

Definition at line 142 of file party.cpp.

◆ removeFromMembers()

void Party::removeFromMembers ( )

Definition at line 121 of file party.cpp.

◆ removeMember() [1/3]

void Party::removeMember ( const std::string &  name)

Removes a member from the party.

Definition at line 107 of file party.cpp.

◆ removeMember() [2/3]

void Party::removeMember ( int  id)

Removes a member from the party.

Definition at line 93 of file party.cpp.

◆ removeMember() [3/3]

void Party::removeMember ( PartyMember member)

Removes a member from the party.

Definition at line 78 of file party.cpp.

◆ setName()

void Party::setName ( const std::string &  name)
inline

Set the party's name.

Definition at line 65 of file party.h.

◆ setRights()

void Party::setRights ( short  rights)

Definition at line 133 of file party.cpp.

Member Data Documentation

◆ mCanInviteUsers

bool Party::mCanInviteUsers = false
private

Definition at line 171 of file party.h.

◆ mId

short Party::mId
private

Definition at line 170 of file party.h.

◆ mMembers

std::vector<PartyMember *> Party::mMembers
private

Definition at line 168 of file party.h.

◆ mName

std::string Party::mName
private

Definition at line 169 of file party.h.

◆ parties

Party::PartyMap Party::parties
staticprivate

Definition at line 159 of file party.h.


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