Logo Search packages:      
Sourcecode: kdegames-kde4 version File versions  Download package

KWin4Doc Class Reference

#include <kwin4doc.h>

Inheritance diagram for KWin4Doc:

KGame KGameNetwork

List of all members.

Detailed Description

The game document or game engine. It is derived from the KGame framework.

Definition at line 45 of file kwin4doc.h.

Public Types

enum  GamePolicy { PolicyUndefined = 0, PolicyClean = 1, PolicyDirty = 2, PolicyLocal = 3 }
enum  GameStatus {
  Init = 0, Run = 1, Pause = 2, End = 3,
  Abort = 4, SystemPause = 5, Intro = 6, UserStatus = 7
typedef QList< KPlayer * > KGamePlayerList

Public Slots

void loadSettings ()
void moveDone (int mode)


void signalAdminStatusChanged (bool isAdmin)
void signalChatChanged (KWin4Player *player)
void signalClientConnected (quint32 clientID)
void signalClientDisconnected (quint32 clientID, bool broken)
void signalClientJoinedGame (quint32 clientid, KGame *me)
void signalClientLeftGame (int clientID, int oldgamestatus, KGame *me)
void signalConnectionBroken ()
void signalGameOver (int status, KPlayer *current, KGame *me)
void signalGameRun ()
void signalLoad (QDataStream &stream)
void signalLoadError (QDataStream &stream, bool network, int cookie, bool &result)
void signalLoadPrePlayers (QDataStream &stream)
void signalMessageUpdate (int msgid, quint32 receiver, quint32 sender)
void signalNetworkData (int msgid, const QByteArray &buffer, quint32 receiver, quint32 sender)
void signalNetworkErrorMessage (int error, QString text)
void signalNextPlayer (int playerNumber)
void signalPlayerJoinedGame (KPlayer *player)
void signalPlayerLeftGame (KPlayer *player)
void signalPropertyChanged (KGamePropertyBase *property, KGame *me)
void signalReplacePlayerIO (KPlayer *player, bool *remove)
void signalSave (QDataStream &stream)
void signalSavePrePlayers (QDataStream &stream)

Public Member Functions

bool activatePlayer (KPlayer *player)
bool addPlayer (KPlayer *newplayer)
bool addProperty (KGamePropertyBase *data)
void calculateHint ()
bool connectToServer (const QString &host, quint16 port)
int cookie () const
KGamePropertyHandlerdataHandler () const
virtual void Debug ()
void disconnect ()
void electAdmin (quint32 clientID)
void endGame (TABLE mode)
KPlayerfindPlayer (quint32 id) const
QString findProcessName ()
KGamePropertyBasefindProperty (int id) const
quint32 gameId () const
KGameSequencegameSequence () const
int gameStatus () const
int getCurrentMove ()
COLOUR getCurrentPlayer ()
int getHistoryCnt ()
int getMaxMove ()
QString getName (COLOUR col)
KWin4PlayergetPlayer (COLOUR col)
int getStatistic (COLOUR col, TABLE mode)
QString hostName () const
bool inactivatePlayer (KPlayer *player)
const KGamePlayerList * inactivePlayerList () const
KGamePlayerList * inactivePlayerList ()
void initPlayers ()
bool isAdmin () const
bool isMaster () const
bool isNetwork () const
bool isOfferingConnections () const
bool isRunning () const
 KWin4Doc (QWidget *parent)
virtual bool load (const QString &filename, bool reset=true)
virtual bool load (QDataStream &stream, bool reset=true)
bool loadgame (QDataStream &stream, bool network, bool reset)
virtual void lock ()
int maxPlayers () const
KMessageClientmessageClient () const
KMessageServermessageServer () const
uint minPlayers () const
virtual void networkTransmission (QDataStream &stream, int msgid, quint32 receiver, quint32 sender, quint32 clientID)
bool offerConnections (quint16 port)
KGameIO::IOMode playedBy (int col)
uint playerCount () const
void playerDeleted (KPlayer *player)
const KGamePlayerList * playerList () const
KGamePlayerList * playerList ()
GamePolicy policy () const
quint16 port () const
KRandomSequence * random () const
void readConfig (KConfig *config)
bool redoMove ()
bool removePlayer (KPlayer *player)
virtual bool reset ()
void resetStatistic ()
virtual bool save (const QString &filename, bool saveplayers=true)
virtual bool save (QDataStream &stream, bool saveplayers=true)
void sendError (int error, const QByteArray &message, quint32 receiver=0, quint32 sender=0)
bool sendGroupMessage (const QString &msg, int msgid, quint32 sender, const QString &group)
bool sendGroupMessage (int msg, int msgid, quint32 sender, const QString &group)
bool sendGroupMessage (const QDataStream &msg, int msgid, quint32 sender, const QString &group)
bool sendGroupMessage (const QByteArray &msg, int msgid, quint32 sender, const QString &group)
bool sendMessage (int data, int msgid, quint32 receiver=0, quint32 sender=0)
bool sendMessage (const QString &msg, int msgid, quint32 receiver=0, quint32 sender=0)
bool sendMessage (const QDataStream &msg, int msgid, quint32 receiver=0, quint32 sender=0)
bool sendMessage (const QByteArray &buffer, int msgid, quint32 receiver=0, quint32 sender=0)
virtual bool sendPlayerInput (QDataStream &msg, KPlayer *player, quint32 sender=0)
bool sendPlayerProperty (int msgid, QDataStream &s, quint32 playerId)
bool sendSystemMessage (const QString &msg, int msgid, quint32 receiver=0, quint32 sender=0)
bool sendSystemMessage (const QDataStream &msg, int msgid, quint32 receiver=0, quint32 sender=0)
bool sendSystemMessage (int data, int msgid, quint32 receiver=0, quint32 sender=0)
bool sendSystemMessage (const QByteArray &buffer, int msgid, quint32 receiver=0, quint32 sender=0)
void setCurrentPlayer (COLOUR no)
void setDiscoveryInfo (const QString &type, const QString &name=QString())
void setGameSequence (KGameSequence *sequence)
void setGameStatus (int status)
void setMaxClients (int max)
void setMaxPlayers (uint maxnumber)
void setMinPlayers (uint minnumber)
void setName (COLOUR col, const QString &n)
void setPlayedBy (int col, KGameIO::IOMode mode)
void setPolicy (GamePolicy p, bool recursive=true)
void setView (KWin4View *view)
bool stopServerConnection ()
COLOUR switchStartPlayer ()
virtual bool systemPlayerInput (QDataStream &msg, KPlayer *player, quint32 sender=0)
bool undoMove ()
virtual void unlock ()
void writeConfig (KConfig *config)
 ~KWin4Doc ()

Protected Slots

void aboutToLoseConnection (quint32 id)
void clientConnected (quint32 cid, KGame *me)
void emitSignal (KGamePropertyBase *me)
void gamePropertyChanged (KGamePropertyBase *prop, KGame *me)
void networkMessageUpdate (int id, quint32 sender, quint32 receiver)
void playerPropertyChanged (KGamePropertyBase *prop, KPlayer *player)
void prepareAITurn (QDataStream &stream, bool b, KGameIO *input, bool *eatevent)
virtual void prepareNext ()
void processAICommand (QDataStream &in, KGameProcessIO *io)
void processAIHintCommand (QDataStream &in, KGameProcessIO *io)
void receivedStderr (const QString &s)
void receiveNetworkTransmission (const QByteArray &a, quint32 clientID)
void repeatMove ()
void sendProperty (int msgid, QDataStream &stream, bool *sent)
void slotAdminStatusChanged (bool isAdmin)
void slotClientConnected (quint32 clientId)
void slotClientDisconnected (quint32 clientId, bool broken)
void slotResetConnection ()
void slotServerDisconnected ()

Protected Member Functions

void activateCurrentPlayer ()
int checkGameOver (int x, COLOUR col)
int checkGameOver (KPlayer *player)
void createIO (KPlayer *player, KGameIO::IOMode io)
KPlayercreatePlayer (int rtti, int io, bool isvirtual)
void deleteInactivePlayers ()
void deletePlayers ()
bool doMove (int x, int id)
COLOUR getColour (int x, int y)
COLOUR getPlayerColour (int player)
KPlayerloadPlayer (QDataStream &stream, bool isvirtual=false)
MOVESTATUS makeMove (int x, int mode)
virtual void negotiateNetworkGame (quint32 clientID)
virtual void newPlayersJoin (KGamePlayerList *oldplayer, KGamePlayerList *newplayer, QList< int > &inactivate)
void newPlayersJoin (KGamePlayerList *list, KGamePlayerList *newList, QList< int > &inactive)
KPlayernextPlayer (KPlayer *last, bool exclusive=true)
bool playerInput (QDataStream &msg, KPlayer *player)
KPlayerplayerInputFinished (KPlayer *player)
void prepareGameMessage (QDataStream &stream, qint32 pl)
void recalcIO ()
void resetGame (bool initview)
virtual bool savegame (QDataStream &stream, bool network, bool saveplayers)
void savePlayer (QDataStream &stream, KPlayer *player)
void savePlayers (QDataStream &stream, KGamePlayerList *list=0)
void setColour (int x, int y, COLOUR c)
void setMaster ()
void setScore (long value)
void syncRandom ()
bool systemActivatePlayer (KPlayer *player)
bool systemAddPlayer (KPlayer *newplayer)
bool systemInactivatePlayer (KPlayer *player)
void systemRemovePlayer (KPlayer *player, bool deleteit)

Private Attributes

QVector< long > mAIValues
KGamePropertyInt mAmzug
KGamePropertyInt mCurrentMove
KGamePropertyArray< int > mField
KGamePropertyArray< int > mFieldFilled
KGamePropertyArray< int > mHistory
KGamePropertyInt mHistoryCnt
KGamePropertyInt mLastColour
KGamePropertyInt mLastColumn
KGamePropertyInt mLastHint
KGamePropertyInt mMaxMove
KGameIO::IOMode mPlayedBy [2]
KGamePropertyInt mScore
KGamePropertyInt mStartPlayer

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

Generated by  Doxygen 1.6.0   Back to index