24 #include "kgamesequence.h" 25 #include "kgamesequence.moc" 30 KGameSequence::KGameSequence() : TQObject()
36 KGameSequence::~KGameSequence()
45 void KGameSequence::setCurrentPlayer(
KPlayer* player)
47 mCurrentPlayer = player;
52 kdDebug(11001) <<
"=================== NEXT PLAYER =========================="<<endl;
55 kdError() << k_funcinfo <<
"NULL game object" << endl;
58 unsigned int minId,nextId,lastId;
59 KPlayer *nextplayer, *minplayer;
69 kdDebug(11001) <<
"nextPlayer: lastId="<<lastId<<endl;
78 for (player = game()->playerList()->first(); player != 0; player=game()->playerList()->next() )
81 if (player->
id() < minId)
91 if (player->
id() > lastId && player->
id() < nextId)
101 nextplayer=minplayer;
104 kdDebug(11001) << k_funcinfo <<
" ##### lastId=" << lastId <<
" exclusive=" 105 << exclusive <<
" minId=" << minId <<
" nextid=" << nextId
106 <<
" count=" << game()->playerList()->count() << endl;
109 nextplayer->
setTurn(
true,exclusive);
void setGame(KGame *game)
Set the KGame object for this sequence.
bool setTurn(bool b, bool exclusive=true)
Sets whether this player is the next to turn.
virtual int checkGameOver(KPlayer *player)
Check whether the game is over.
TQ_UINT32 id() const
Returns the id of the player.
virtual KPlayer * nextPlayer(KPlayer *last, bool exclusive=true)
Select the next player in a turn based game.
Base class for a game player.
The main KDE game object.