• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • libtdegames
 

libtdegames

  • libtdegames
  • kgame
kgamesequence.h
1/*
2 This file is part of the TDE games library
3 Copyright (C) 2003 Andreas Beckermann (b_mann@gmx.de)
4 Copyright (C) 2003 Martin Heni (martin@heni-online.de)
5
6 This library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Library General Public
8 License version 2 as published by the Free Software Foundation.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Library General Public License for more details.
14
15 You should have received a copy of the GNU Library General Public License
16 along with this library; see the file COPYING.LIB. If not, write to
17 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA.
19*/
20/*
21 $Id$
22*/
23#ifndef __KGAMESEQUENCE_H_
24#define __KGAMESEQUENCE_H_
25
26#include <tqobject.h>
27
28class KPlayer;
29class KGame;
30
42class KGameSequence : public TQObject
43{
44 TQ_OBJECT
45
46public:
47 KGameSequence();
48 virtual ~KGameSequence();
49
55 virtual KPlayer* nextPlayer(KPlayer *last, bool exclusive = true);
56
57 virtual void setCurrentPlayer(KPlayer* p);
58
62 KGame* game() const { return mGame; }
63
64 KPlayer* currentPlayer() const { return mCurrentPlayer; }
65
71 void setGame(KGame* game);
72
80 virtual int checkGameOver(KPlayer *player);
81
82private:
83 KGame* mGame;
84 KPlayer* mCurrentPlayer;
85};
86
87#endif
88
KGameSequence
This class takes care of round or move management as well of the gameover condition.
Definition: kgamesequence.h:43
KGameSequence::game
KGame * game() const
Definition: kgamesequence.h:62
KGameSequence::setGame
void setGame(KGame *game)
Set the KGame object for this sequence.
Definition: kgamesequence.cpp:40
KGameSequence::nextPlayer
virtual KPlayer * nextPlayer(KPlayer *last, bool exclusive=true)
Select the next player in a turn based game.
Definition: kgamesequence.cpp:50
KGameSequence::checkGameOver
virtual int checkGameOver(KPlayer *player)
Check whether the game is over.
Definition: kgamesequence.cpp:119
KGame
The main KDE game object.
Definition: kgame.h:63
KPlayer
Base class for a game player.
Definition: kplayer.h:70

libtdegames

Skip menu "libtdegames"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

libtdegames

Skip menu "libtdegames"
  • libtdegames
Generated for libtdegames by doxygen 1.9.4
This website is maintained by Timothy Pearson.