/*************************************************************************** * Copyright (C) 1980-2005 Artur Wiebe * * artur@wiebenet.de * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #ifndef _NETWORKPLAYER_H_ #define _NETWORKPLAYER_H_ #include "player.h" #include "clientsocket.h" #include class myServerSocket; class myNetworkPlayer : public myPlayer { Q_OBJECT public: myNetworkPlayer(bool white, int rules,bool server, const QString& ip, int port); ~myNetworkPlayer(); virtual void yourTurn(Checkers* game); virtual void sendMove(const QString& line); virtual void stop(); virtual void acceptPlay(bool); virtual bool isNetwork() const { return true; } virtual bool isServer() const { return m_server; } virtual void sendNextRound(); public slots: virtual void sendMessage(const QString&); private slots: void slotReceived(const QString& data); void slotJoinOrCreate(); void slotReady(bool); private: void parseMove(const QString& line); void send(const QString& kw, const QString& text); private: Checkers* game; myClientSocket* m_client; myServerSocket* m_server; }; #endif