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

libkdegames/kggzmod

KGGZMod::Event

KGGZMod::Event Class Reference

#include <event.h>

Inheritance diagram for KGGZMod::Event:

Inheritance graph
[legend]

List of all members.


Detailed Description

Events from the GGZ core client.

When there is some important information from the GGZ core client to the game client, an event is submitted in Module::signalEvent. In most cases the event is originating from the GGZ server.

Depending on the type of the event, the more general Event object can be casted to specific objects of type LaunchEvent, ServerEvent, SelfEvent, SeatEvent, ChatEvent, StatsEvent and InfoEvent. However, this is not strictly needed, as all data is available from the public data hashtable, should a game wish to use this instead.

None of the events must be handled by the game client, especially when using the KGGZSeatsDialog class for player management. However, it is often convenient to catch the ServerEvent to get the file descriptor which refers to the connection to the game server.

Author:
Josef Spillner (josef@ggzgamingzone.org)

Definition at line 55 of file event.h.


Public Types

enum  Type {
  launch, server, self, seat,
  chat, stats, info, rankings
}

Public Member Functions

 Event (Type type)
Player * player () const
Type type () const

Public Attributes

QMap< QString, QString > data

Protected Attributes

Player * m_player

Member Enumeration Documentation

enum KGGZMod::Event::Type

The type of the event.

Depending on this type, the object might be casted to a more specific class.

Enumerator:
launch  Game was launched.

server  Connected to server.

self  Your seat was assigned.

seat  Someone's seat changed.

chat  A chat message was received.
stats  Statistics have been received for a player.

info  Information about a player has arrived.

rankings  Experimental: Rankings information for this game/room.

Definition at line 65 of file event.h.


Constructor & Destructor Documentation

Event::Event ( Type  type  ) 

Creates an event of a specific type.

The event will not be valid until all data fields are properly filled out. Therefore, only the Module is supposed to create event objects.

Parameters:
type Type of the event

For internal use only.

Definition at line 25 of file event.cpp.


Member Function Documentation

Player * Event::player (  )  const

Returns the pointer to the player associated with the event.

If no player is associated, this returns null.

Returns:
player associated with an event

Reimplemented in KGGZMod::SeatEvent, KGGZMod::ChatEvent, KGGZMod::StatsEvent, and KGGZMod::InfoEvent.

Definition at line 36 of file event.cpp.

Event::Type Event::type (  )  const

Returns the type of an event.

Returns:
type of an event

Definition at line 31 of file event.cpp.


Member Data Documentation

QMap<QString, QString> KGGZMod::Event::data

Data storage for all events.

Independent of the actual type of the event, all important data is stored in this map.

Definition at line 112 of file event.h.

Player* KGGZMod::Event::m_player [protected]

Definition at line 115 of file event.h.


The documentation for this class was generated from the following files:
  • event.h
  • event.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