| 1 | /*************************************************************************** |
| 2 | * Copyright (C) 2004-2007 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 _COMPUTERPLAYER_H_ |
| 22 | #define _COMPUTERPLAYER_H_cxx . . $ `src/computerplayer.h:22:9`! |
| 23 | |
| 24 | |
| 25 | #include <QThread> |
| 26 | |
| 27 | #include "player.h"cxx . . $ `<file>/src/player.h`/ |
| 28 | |
| 29 | |
| 30 | class myThreadcxx . . $ myThread#; |
| 31 | |
| 32 | |
| 33 | class myComputerPlayercxx . . $ myComputerPlayer# : public myPlayercxx . . $ myPlayer# |
| 34 | { |
| 35 | Q_OBJECTcxx . . $ QMetaObject#Call# |
| 36 | |
| 37 | public: |
| 38 | myComputerPlayercxx . . $ myComputerPlayer#myComputerPlayer(f9776a75d1fc6294).(const QStringcxx . . $ QString#& name, bool white, int skill); |
| 39 | ~cxx . . $ myComputerPlayer#`~myComputerPlayer`(ced63f7c635d850d).myComputerPlayercxx . . $ myComputerPlayer#(); |
| 40 | |
| 41 | virtual void yourTurncxx . . $ myComputerPlayer#yourTurn(9164dfc221f1086f).(const Checkerscxx . . $ Checkers#* game); |
| 42 | virtual void stopcxx . . $ myComputerPlayer#stop(49f6e7a06ebc5aa8).(); |
| 43 | |
| 44 | // need this to process thread's events |
| 45 | virtual void customEventcxx . . $ myComputerPlayer#customEvent(c2473e2e70986fd7).(QEventcxx . . $ QEvent#*); |
| 46 | |
| 47 | private: |
| 48 | myThreadcxx . . $ myThread#* m_threadcxx . . $ myComputerPlayer#m_thread.; |
| 49 | Checkerscxx . . $ Checkers#* m_gamecxx . . $ myComputerPlayer#m_game.; |
| 50 | int m_skillcxx . . $ myComputerPlayer#m_skill.; |
| 51 | }; |
| 52 | |
| 53 | |
| 54 | |
| 55 | /****************************************************************************/ |
| 56 | class myThreadcxx . . $ myThread# : public QThreadcxx . . $ QThread# { |
| 57 | public: |
| 58 | myThreadcxx . . $ myThread#myThread(bf0a7e61153f5cc1).(myComputerPlayercxx . . $ myComputerPlayer#* p, Checkerscxx . . $ Checkers#* g) |
| 59 | : m_playercxx . . $ myThread#m_player.(p), m_gamecxx . . $ myThread#m_game.(g), m_abortedcxx . . $ myThread#m_aborted.(false) {} |
| 60 | |
| 61 | virtual void runcxx . . $ myThread#run(49f6e7a06ebc5aa8).(); |
| 62 | |
| 63 | void stopcxx . . $ myThread#stop(49f6e7a06ebc5aa8).(); |
| 64 | |
| 65 | Checkerscxx . . $ Checkers#* gamecxx . . $ myThread#game(ea34bf9f2ff32ffe).() const { return m_gamecxx . . $ myThread#m_game.; } |
| 66 | |
| 67 | private: |
| 68 | myComputerPlayercxx . . $ myComputerPlayer#* m_playercxx . . $ myThread#m_player.; |
| 69 | Checkerscxx . . $ Checkers#* m_gamecxx . . $ myThread#m_game.; |
| 70 | bool m_abortedcxx . . $ myThread#m_aborted.; |
| 71 | }; |
| 72 | |
| 73 | |
| 74 | #endif |