Logo Search packages:      
Sourcecode: kdegames version File versions

Kwin4Doc Class Reference

#include <kwin4doc.h>

Inheritance diagram for Kwin4Doc:

KGame KGameNetwork

List of all members.


Detailed Description

The board "engine"

Definition at line 48 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 QPtrList< KPlayerKGamePlayerList

Public Slots

void calcHint ()
void loadSettings ()
void moveDone (QCanvasItem *, int)
void slotClientConnected (Q_UINT32, KGame *)
void slotGameOver (int status, KPlayer *p, KGame *me)
void slotMessageUpdate (int, Q_UINT32, Q_UINT32)
void slotPlayerPropertyChanged (KGamePropertyBase *, KPlayer *)
void slotPrepareTurn (QDataStream &stream, bool b, KGameIO *input, bool *eatevent)
void slotProcessHint (QDataStream &, KGameProcessIO *)
void slotProcessQuery (QDataStream &, KGameProcessIO *)
void slotPropertyChanged (KGamePropertyBase *, KGame *)
void slotRepeatMove ()

Signals

void GameOver (int, KPlayer *, KGame *)
void signalAdminStatusChanged (bool isAdmin)
void signalChatChanged (Kwin4Player *)
void signalClientConnected (Q_UINT32 clientID)
void signalClientDisconnected (Q_UINT32 clientID, bool broken)
void signalClientJoinedGame (Q_UINT32 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, Q_UINT32 receiver, Q_UINT32 sender)
void signalMoveDone (int, int)
void signalNetworkData (int msgid, const QByteArray &buffer, Q_UINT32 receiver, Q_UINT32 sender)
void signalNetworkErrorMessage (int error, QString text)
void signalNextPlayer ()
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)
void addPlayer (KPlayer *newplayer)
bool addProperty (KGamePropertyBase *data)
int CheckGameOver (int x, FARBE col)
bool connectToServer (const QString &host, Q_UINT16 port)
int cookie () const
void createIO (KPlayer *player, KGameIO::IOMode io)
KPlayercreatePlayer (int rtti, int io, bool isvirtual)
KGamePropertyHandlerdataHandler () const
virtual void Debug ()
void disconnect ()
void electAdmin (Q_UINT32 clientID)
void EndGame (TABLE mode)
KPlayerfindPlayer (Q_UINT32 id) const
KGamePropertyBasefindProperty (int id) const
Q_UINT32 gameId () const
KGameSequencegameSequence () const
int gameStatus () const
Kwin4Player * getPlayer (FARBE col)
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, const char *name=0)
virtual bool load (QString filename, bool reset=true)
virtual bool load (QDataStream &stream, bool reset=true)
bool loadgame (QDataStream &stream, bool network, bool reset)
virtual void lock ()
MOVESTATUS MakeMove (int x, int mode)
int maxPlayers () const
KMessageClientmessageClient () const
KMessageServermessageServer () const
uint minPlayers () const
virtual void networkTransmission (QDataStream &stream, int msgid, Q_UINT32 receiver, Q_UINT32 sender, Q_UINT32 clientID)
void newPlayersJoin (KGamePlayerList *, KGamePlayerList *, QValueList< int > &)
KPlayernextPlayer (KPlayer *last, bool exclusive=true)
bool offerConnections (Q_UINT16 port)
KGameIO::IOMode playedBy (int col)
uint playerCount () const
void playerDeleted (KPlayer *player)
const KGamePlayerList * playerList () const
KGamePlayerList * playerList ()
GamePolicy policy () const
Q_UINT16 port () const
FARBE QueryColour (int x, int y)
int QueryCurrentMove ()
FARBE QueryCurrentPlayer ()
int QueryHeight (int x)
int QueryHistoryCnt ()
FARBE QueryLastcolour ()
int QueryLastcolumn ()
int QueryLastHint ()
int QueryMaxMove ()
QString QueryName (FARBE i)
FARBE QueryPlayerColour (int player)
QString QueryProcessName ()
int QueryStat (FARBE i, TABLE mode)
KRandomSequence * random () const
void ReadConfig (KConfig *config)
bool RedoMove ()
bool removePlayer (KPlayer *player)
virtual bool reset ()
void ResetGame (bool initview)
void ResetStat ()
virtual bool save (QString filename, bool saveplayers=true)
virtual bool save (QDataStream &stream, bool saveplayers=true)
void sendError (int error, const QByteArray &message, Q_UINT32 receiver=0, Q_UINT32 sender=0)
bool sendGroupMessage (const QString &msg, int msgid, Q_UINT32 sender, const QString &group)
bool sendGroupMessage (int msg, int msgid, Q_UINT32 sender, const QString &group)
bool sendGroupMessage (const QDataStream &msg, int msgid, Q_UINT32 sender, const QString &group)
bool sendGroupMessage (const QByteArray &msg, int msgid, Q_UINT32 sender, const QString &group)
bool sendMessage (int data, int msgid, Q_UINT32 receiver=0, Q_UINT32 sender=0)
bool sendMessage (const QString &msg, int msgid, Q_UINT32 receiver=0, Q_UINT32 sender=0)
bool sendMessage (const QDataStream &msg, int msgid, Q_UINT32 receiver=0, Q_UINT32 sender=0)
bool sendMessage (const QByteArray &buffer, int msgid, Q_UINT32 receiver=0, Q_UINT32 sender=0)
virtual bool sendPlayerInput (QDataStream &msg, KPlayer *player, Q_UINT32 sender=0)
bool sendPlayerProperty (int msgid, QDataStream &s, Q_UINT32 playerId)
bool sendSystemMessage (const QString &msg, int msgid, Q_UINT32 receiver=0, Q_UINT32 sender=0)
bool sendSystemMessage (const QDataStream &msg, int msgid, Q_UINT32 receiver=0, Q_UINT32 sender=0)
bool sendSystemMessage (int data, int msgid, Q_UINT32 receiver=0, Q_UINT32 sender=0)
bool sendSystemMessage (const QByteArray &buffer, int msgid, Q_UINT32 receiver=0, Q_UINT32 sender=0)
void SetColour (int x, int y, FARBE c)
void SetCurrentMove (int)
void SetCurrentPlayer (FARBE i)
void setGameSequence (KGameSequence *sequence)
void setGameStatus (int status)
void setMaxClients (int max)
void setMaxPlayers (uint maxnumber)
void setMinPlayers (uint minnumber)
void SetName (FARBE i, QString n)
void setPlayedBy (int col, KGameIO::IOMode mode)
void setPolicy (GamePolicy p, bool recursive=true)
void SetScore (long i)
void setView (Kwin4View *view)
bool stopServerConnection ()
FARBE SwitchStartPlayer ()
virtual bool systemPlayerInput (QDataStream &msg, KPlayer *player, Q_UINT32 sender=0)
bool UndoMove ()
virtual void unlock ()
void WriteConfig (KConfig *config)

Protected Slots

void aboutToLoseConnection (Q_UINT32 id)
void emitSignal (KGamePropertyBase *me)
virtual void prepareNext ()
void receiveNetworkTransmission (const QByteArray &a, Q_UINT32 clientID)
void sendProperty (int msgid, QDataStream &stream, bool *sent)
void slotAdminStatusChanged (bool isAdmin)
void slotClientConnected (Q_UINT32 clientId)
void slotClientDisconnected (Q_UINT32 clientId, bool broken)
void slotResetConnection ()
void slotServerDisconnected ()

Protected Member Functions

int checkGameOver (KPlayer *)
void deleteInactivePlayers ()
void deletePlayers ()
KPlayerloadPlayer (QDataStream &stream, bool isvirtual=false)
bool Move (int x, int id)
virtual void negotiateNetworkGame (Q_UINT32 clientID)
virtual void newPlayersJoin (KGamePlayerList *oldplayer, KGamePlayerList *newplayer, QValueList< int > &inactivate)
bool playerInput (QDataStream &msg, KPlayer *player)
KPlayerplayerInputFinished (KPlayer *player)
void prepareGameMessage (QDataStream &stream, Q_INT32 pl)
void preparePlayerTurn ()
void recalcIO ()
virtual bool savegame (QDataStream &stream, bool network, bool saveplayers)
void savePlayer (QDataStream &stream, KPlayer *player)
void savePlayers (QDataStream &stream, KGamePlayerList *list=0)
void setMaster ()
void syncRandom ()
bool systemActivatePlayer (KPlayer *player)
void systemAddPlayer (KPlayer *newplayer)
bool systemInactivatePlayer (KPlayer *player)
void systemRemovePlayer (KPlayer *player, bool deleteit)

Private Attributes

KGamePropertyInt mAmzug
KGamePropertyInt mCurrentMove
KGamePropertyArray< int > mField
KGamePropertyArray< int > mFieldFilled
KGameProcessIOmHintProcess
KGamePropertyArray< int > mHistory
KGamePropertyInt mHistoryCnt
KGamePropertyInt mLastColour
KGamePropertyInt mLastColumn
KGamePropertyInt mLastHint
KGamePropertyInt mMaxMove
KGameIO::IOMode mPlayedBy [NOOFPLAYER]
KGamePropertyInt mScore
KGamePropertyInt mStartPlayer
Kwin4ViewpView
Kwin4Player * yellowPlayer

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

Generated by  Doxygen 1.6.0   Back to index