| 1 | /*************************************************************************** |
| 2 | * Copyright (C) 2004-2005 by Artur Wiebe * |
| 3 | * [email protected] * |
| 4 | * * |
| 5 | * This program is free software; you can redistribute it and/or modify * |
| 6 | * it under the terms of the GNU General Public License as published by * |
| 7 | * the Free Software Foundation; either version 2 of the License, or * |
| 8 | * (at your option) any later version. * |
| 9 | * * |
| 10 | * This program 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 * |
| 13 | * GNU General Public License for more details. * |
| 14 | * * |
| 15 | * You should have received a copy of the GNU General Public License * |
| 16 | * along with this program; if not, write to the * |
| 17 | * Free Software Foundation, Inc., * |
| 18 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
| 19 | ***************************************************************************/ |
| 20 | |
| 21 | #ifndef _PLAYER_H_ |
| 22 | #define _PLAYER_H_cxx . . $ `src/player.h:22:9`! |
| 23 | |
| 24 | #include <QObject> |
| 25 | |
| 26 | |
| 27 | class Checkerscxx . . $ Checkers#; |
| 28 | class Fieldcxx . . $ Field#; |
| 29 | |
| 30 | |
| 31 | class myPlayercxx . . $ myPlayer# : public QObjectcxx . . $ QObject# |
| 32 | { |
| 33 | Q_OBJECTcxx . . $ QMetaObject#Call# |
| 34 | |
| 35 | public: |
| 36 | myPlayercxx . . $ myPlayer#myPlayer(37c160c81b6367f7).(const QStringcxx . . $ QString#& name, bool white) |
| 37 | : m_namecxx . . $ QString#QString(132dd6869045752b).(name), m_whitecxx . . $ myPlayer#m_white.(white), m_opponentcxx . . $ myPlayer#m_opponent.(0) {} |
| 38 | |
| 39 | // information |
| 40 | bool isWhitecxx . . $ myPlayer#isWhite(50ce9a9e25b4a850).() const { return m_whitecxx . . $ myPlayer#m_white.; } |
| 41 | void setWhitecxx . . $ myPlayer#setWhite(b45ddcbc8423892c).(bool b) { m_whitecxx . . $ myPlayer#m_white. = b; } |
| 42 | // |
| 43 | const QStringcxx . . $ QString#& namecxx . . $ myPlayer#name(a2fb7a6ce195d51).() const { return m_namecxx . . $ myPlayer#m_name.; } |
| 44 | void setNamecxx . . $ myPlayer#setName(3520e46b33348bf6).(const QStringcxx . . $ QString#& n) { m_namecxx . . $ myPlayer#m_name. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). n; } |
| 45 | // |
| 46 | virtual bool isHumancxx . . $ myPlayer#isHuman(50ce9a9e25b4a850).() const { return false; } |
| 47 | |
| 48 | // |
| 49 | virtual void yourTurncxx . . $ myPlayer#yourTurn(9164dfc221f1086f).(const Checkerscxx . . $ Checkers#* game) = 0; |
| 50 | // return false on incorrect course. |
| 51 | // set select to true to select the select, or unselect. |
| 52 | // QString contains error msg. |
| 53 | virtual bool fieldClickedcxx . . $ myPlayer#fieldClicked(3ac92b0331bc49b4).(int, bool*, bool, QStringcxx . . $ QString#&) { return true; } |
| 54 | // computerplayer terminates his thinking thread. |
| 55 | // humanplayer |
| 56 | // networkplayer disconnects from the server. |
| 57 | virtual void stopcxx . . $ myPlayer#stop(49f6e7a06ebc5aa8).() = 0; |
| 58 | |
| 59 | void setOpponentcxx . . $ myPlayer#setOpponent(a923b101fe64facf).(myPlayercxx . . $ myPlayer#* o) { m_opponentcxx . . $ myPlayer#m_opponent.=o; } |
| 60 | myPlayercxx . . $ myPlayer#* opponentcxx . . $ myPlayer#opponent(419aab2e9c3a4e42).() const { return m_opponentcxx . . $ myPlayer#m_opponent.; } |
| 61 | |
| 62 | signalscxx . . $ `<external>/1208926524888476972/qobjectdefs.h:89:14`!: |
| 63 | // emitted when move is done, provides the complete board converted to |
| 64 | // string. |
| 65 | void moveDonecxx . . $ myPlayer#moveDone(3520e46b33348bf6).(const QStringcxx . . $ QString#&); |
| 66 | |
| 67 | private: |
| 68 | QStringcxx . . $ QString# m_namecxx . . $ myPlayer#m_name.; |
| 69 | bool m_whitecxx . . $ myPlayer#m_white.; |
| 70 | |
| 71 | myPlayercxx . . $ myPlayer#* m_opponentcxx . . $ myPlayer#m_opponent.; |
| 72 | }; |
| 73 | |
| 74 | |
| 75 | #endif |