• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

libkdegames/kggzmod

KGGZMod::Player

KGGZMod::Player Class Reference

#include <player.h>

List of all members.


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.

Author:
Josef Spillner (josef@ggzgamingzone.org)

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

enum KGGZMod::Player::Type

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:
unknown  The type of a seat is not yet known.

open  A seat is open and also not reserved.

bot  This is a bot player (a server-side AI player).

player  This is a regular player.

reserved  The seat is reserved for someone.

abandoned  The seat has been abandoned by a player.

spectator  This is a spectator who does only watch the game.

Definition at line 65 of file player.h.


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 type a seat has.

Returns:
seat type

Definition at line 37 of file player.cpp.


The documentation for this class was generated from the following files:
  • player.h
  • player.cpp

libkdegames/kggzmod

Skip menu "libkdegames/kggzmod"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members

API Reference

Skip menu "API Reference"
  • kblackbox
  • kgoldrunner
  • kmahjongg
  • ksquares
  • libkdegames
  •   highscore
  •   kgame
  •   kggzgames
  •   kggzmod
  •   kggznet
  • libkmahjongg
Generated for API Reference by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal