File indexing completed on 2024-10-06 06:46:38

0001 // Copyright (c) 2002 Rob Kaper <cap@capsi.com>
0002 //
0003 // This library is free software; you can redistribute it and/or
0004 // modify it under the terms of the GNU Lesser General Public
0005 // License version 2.1 as published by the Free Software Foundation.
0006 //
0007 // This library is distributed in the hope that it will be useful,
0008 // but WITHOUT ANY WARRANTY; without even the implied warranty of
0009 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0010 // Lesser General Public License for more details.
0011 //
0012 // You should have received a copy of the GNU Lesser General Public License
0013 // along with this library; see the file COPYING.LIB.  If not, write to
0014 // the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0015 // Boston, MA 02110-1301, USA.
0016 
0017 /*
0018 #include <atlantic_core.h>
0019 #include <player.h>
0020 #include <estate.h>
0021 #include <estategroup.h>
0022 #include <trade.h>
0023 #include <auction.h>
0024 */
0025 
0026 #include <estate.h>
0027 
0028 #include "monopdprotocol.h"
0029 
0030 MonopdProtocol::MonopdProtocol()
0031     : QObject()
0032 {
0033 }
0034 
0035 void MonopdProtocol::auctionEstate()
0036 {
0037     sendData(QStringLiteral(".ea"));
0038 }
0039 
0040 void MonopdProtocol::buyEstate()
0041 {
0042     sendData(QStringLiteral(".eb"));
0043 }
0044 
0045 void MonopdProtocol::confirmTokenLocation(Estate *estate)
0046 {
0047     QString data(QStringLiteral(".t"));
0048     data.append(QString::number(estate ? estate->id() : -1));
0049     sendData(data);
0050 }
0051 
0052 void MonopdProtocol::endTurn()
0053 {
0054     sendData(QStringLiteral(".E"));
0055 }
0056 
0057 void MonopdProtocol::rollDice()
0058 {
0059     sendData(QStringLiteral(".r"));
0060 }
0061 
0062 void MonopdProtocol::setName(const QString &name)
0063 {
0064     QString data(QStringLiteral(".n"));
0065     data.append(name);
0066     sendData(data);
0067 }
0068 
0069 void MonopdProtocol::startGame()
0070 {
0071     sendData(QStringLiteral(".gs"));
0072 }
0073 
0074 void MonopdProtocol::sendData(const QString&)
0075 {
0076     // Your reimplementation of this method should send send data over the
0077     // network.
0078 }
0079 
0080 #include "moc_monopdprotocol.cpp"