libkdegames/kggzmod
KGGZMod::Player Class Reference
#include <player.h>
Detailed Description
Player representation of an online game.Every participant in an online game is represented by an object of this class. This includes active players, but also passive spectators, bots and even open seats. The Type attribute differentiates those objects.
While a player's name is always present, the statistics and extended information such as a photo or the real name are not. If they're needed, requests of type InfoRequest must be sent out, and events of type InfoEvent and StatsEvent must have been received.
Seat assignments can be changed by sending further requests. The KGGZSeatsDialog can be used to avoid the manual usage of all of those requests.
Definition at line 54 of file player.h.
Public Types | |
| enum | Type { unknown, open, bot, player, reserved, abandoned, spectator } |
Public Member Functions | |
| QString | hostname () const |
| QString | name () const |
| QString | photo () const |
| QString | realname () const |
| int | seat () const |
| Statistics * | stats () const |
| Type | type () const |
Member Enumeration Documentation
The type of which a seat can be.
While spectators sit on the sidelines, players and bots along with open/reserved/abandoned seats are the ones which participate in a game.
- Enumerator:
Member Function Documentation
| QString Player::hostname | ( | ) | const |
Returns the hostname of the player.
If the game requires revealing the players' addresses and the player has agreed to do so, this returns the address as a hostname or IP address. This information depends on a previously sent InfoRequest.
- Returns:
- player hostname
Definition at line 57 of file player.cpp.
| QString Player::name | ( | ) | const |
The name of a player.
This is the actual name for normal players and for bot players. It refers to a name for reserved and abandoned seats. Open seats do not have a name associated with them.
- Returns:
- name of the player or bot
Definition at line 42 of file player.cpp.
| QString Player::photo | ( | ) | const |
Returns the photo of the player.
If the player has added a photo of him/herself or an avatar picture is available in the database, this returns an URL to the image. This information depends on a previously sent InfoRequest.
- Returns:
- player photo
Definition at line 62 of file player.cpp.
| QString Player::realname | ( | ) | const |
Returns the realname of the player.
If the player has identified him/herself with a real name in the database, this can be retrieved for display purposes. This information depends on a previously sent InfoRequest.
- Returns:
- player realname
Definition at line 67 of file player.cpp.
| int Player::seat | ( | ) | const |
The seat number.
This number is used to associate a player object uniquely with other information.
- Returns:
- number of the seat
Definition at line 47 of file player.cpp.
| Statistics * Player::stats | ( | ) | const |
Statistics for a given player.
In most cases this will not be present. Only for normal players and only if a StatsEvent has been received, the statistics for the players become available.
- Returns:
- player statistics, or null if not present
Definition at line 52 of file player.cpp.
| Player::Type Player::type | ( | ) | const |
The documentation for this class was generated from the following files:
KDE 4.2 API Reference