#include <kgamesequence.h>
Collaboration diagram for KGameSequence:

Public Member Functions | |
| KGameSequence () | |
| virtual | ~KGameSequence () |
| virtual KPlayer * | nextPlayer (KPlayer *last, bool exclusive=true) |
| Select the next player in a turn based game. | |
| virtual void | setCurrentPlayer (KPlayer *p) |
| KGame * | game () const |
| KPlayer * | currentPlayer () const |
| void | setGame (KGame *game) |
| Set the KGame object for this sequence. | |
| virtual int | checkGameOver (KPlayer *player) |
| Check whether the game is over. | |
It is especially used for round based games. For these games nextPlayer and checkGameOver are the most important methods.
You can subclass KGameSequence and use KGame::setGameSequence to use your own rules. Note that KGame will take ownership and therefore will delete the object on destruction.
Definition at line 42 of file kgamesequence.h.
|
|
Definition at line 30 of file kgamesequence.cpp. |
|
|
Definition at line 36 of file kgamesequence.cpp. |
|
|
Check whether the game is over. The default implementation always returns 0.
Definition at line 119 of file kgamesequence.cpp. Referenced by KGame::checkGameOver(). |
|
|
Definition at line 63 of file kgamesequence.h. |
|
|
Definition at line 61 of file kgamesequence.h. Referenced by nextPlayer(), and setGame(). |
|
||||||||||||
|
Select the next player in a turn based game. In an asynchronous game this function has no meaning. Overwrite this function for your own game sequence. Per default it selects the next player in the playerList Definition at line 50 of file kgamesequence.cpp. References game(), KPlayer::id(), and KGame::playerList(). Referenced by KGame::nextPlayer(). Here is the call graph for this function: ![]() |
|
|
Definition at line 45 of file kgamesequence.cpp. Referenced by KGame::loadgame(), and KGame::playerInputFinished(). |
|
|
Set the KGame object for this sequence. This is called automatically by KGame::setGameSequence and you should not call it. Definition at line 40 of file kgamesequence.cpp. References game(). Referenced by KGame::setGameSequence(). Here is the call graph for this function: ![]() |
1.4.6