| 1 | /*************************************************************************** |
| 2 | * Copyright (C) 2009 by The qGo Project * |
| 3 | * * |
| 4 | * This file is part of qGo. * |
| 5 | * * |
| 6 | * qGo is free software: you can redistribute it and/or modify * |
| 7 | * it under the terms of the GNU General Public License as published by * |
| 8 | * the Free Software Foundation; either version 2 of the License, or * |
| 9 | * (at your option) any later version. * |
| 10 | * * |
| 11 | * This program is distributed in the hope that it will be useful, * |
| 12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of * |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * |
| 14 | * GNU General Public License for more details. * |
| 15 | * * |
| 16 | * You should have received a copy of the GNU General Public License * |
| 17 | * along with this program; if not, see <http://www.gnu.org/licenses/> * |
| 18 | * or write to the Free Software Foundation, Inc., * |
| 19 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * |
| 20 | ***************************************************************************/ |
| 21 | |
| 22 | |
| 23 | class PlayerListingcxx . . $ PlayerListing#; |
| 24 | class MatchRequestcxx . . $ MatchRequest#; |
| 25 | class GameDatacxx . . $ GameData#; |
| 26 | |
| 27 | class MatchNegotiationStatecxx . . $ MatchNegotiationState# |
| 28 | { |
| 29 | public: |
| 30 | MatchNegotiationStatecxx . . $ MatchNegotiationState#MatchNegotiationState(49f6e7a06ebc5aa8).(void) : statecxx . . $ MatchNegotiationState#state.(MSNONEcxx . . $ MatchNegotiationState#MSNONE.), playercxx . . $ MatchNegotiationState#player.(0), opponentcxx . . $ MatchNegotiationState#opponent.(QStringcxx . . $ QString#QString(ced63f7c635d850d).()), game_numbercxx . . $ MatchNegotiationState#game_number.(0), negotiation_brokencxx . . $ MatchNegotiationState#negotiation_broken.(false), match_requestcxx . . $ MatchNegotiationState#match_request.(0) {}; |
| 31 | |
| 32 | bool brokencxx . . $ MatchNegotiationState#broken(c9857a73d68e59ba).(void) { return negotiation_brokencxx . . $ MatchNegotiationState#negotiation_broken.; }; |
| 33 | PlayerListingcxx . . $ PlayerListing# * getPlayerListingcxx . . $ MatchNegotiationState#getPlayerListing(8a20cf3761bafdec).(void) { return playercxx . . $ MatchNegotiationState#player.; }; |
| 34 | unsigned short getGameIdcxx . . $ MatchNegotiationState#getGameId(32a7769d58713265).(void) { return game_numbercxx . . $ MatchNegotiationState#game_number.; }; |
| 35 | void setGameIdcxx . . $ MatchNegotiationState#setGameId(ed53e3bbd3fa2f69).(unsigned short id) { game_numbercxx . . $ MatchNegotiationState#game_number. = id; }; |
| 36 | void setCountingVerificationcxx . . $ MatchNegotiationState#setCountingVerification(ed53e3bbd3fa2f69).(unsigned short v) { counting_verificationcxx . . $ MatchNegotiationState#counting_verification. = v; }; |
| 37 | unsigned short getCountingVerificationcxx . . $ MatchNegotiationState#getCountingVerification(32a7769d58713265).(void) { return counting_verificationcxx . . $ MatchNegotiationState#counting_verification.; }; |
| 38 | QStringcxx . . $ QString# & getOpponentcxx . . $ MatchNegotiationState#getOpponent(d436534e89c8f252).(void) { return opponentcxx . . $ MatchNegotiationState#opponent.; }; |
| 39 | void setPlayercxx . . $ MatchNegotiationState#setPlayer(122195e397f39e1b).(PlayerListingcxx . . $ PlayerListing# * p) { playercxx . . $ MatchNegotiationState#player. = p; }; |
| 40 | |
| 41 | bool newMatchAllowedcxx . . $ MatchNegotiationState#newMatchAllowed(c9857a73d68e59ba).(void); |
| 42 | bool canEnterRematchAdjournedcxx . . $ MatchNegotiationState#canEnterRematchAdjourned(c9857a73d68e59ba).(void); |
| 43 | bool inGamecxx . . $ MatchNegotiationState#inGame(c9857a73d68e59ba).(void); |
| 44 | bool isOurGamecxx . . $ MatchNegotiationState#isOurGame(3c978dac0e5ee2ad).(unsigned short id); |
| 45 | bool sentMatchInvitecxx . . $ MatchNegotiationState#sentMatchInvite(c9857a73d68e59ba).(void); |
| 46 | bool sentMatchOfferPendingcxx . . $ MatchNegotiationState#sentMatchOfferPending(c9857a73d68e59ba).(void); |
| 47 | bool justCreatedRoomcxx . . $ MatchNegotiationState#justCreatedRoom(c9857a73d68e59ba).(void); |
| 48 | bool waitingForRoomNumbercxx . . $ MatchNegotiationState#waitingForRoomNumber(c9857a73d68e59ba).(void); |
| 49 | bool sentJoinRoomcxx . . $ MatchNegotiationState#sentJoinRoom(c9857a73d68e59ba).(void) { return waitingForMatchOffercxx . . $ MatchNegotiationState#waitingForMatchOffer(c9857a73d68e59ba).(); }; |
| 50 | bool waitingForMatchOffercxx . . $ MatchNegotiationState#waitingForMatchOffer(c9857a73d68e59ba).(void); |
| 51 | bool startMatchAcceptablecxx . . $ MatchNegotiationState#startMatchAcceptable(c9857a73d68e59ba).(void); |
| 52 | bool isOngoingMatchcxx . . $ MatchNegotiationState#isOngoingMatch(3c978dac0e5ee2ad).(unsigned short id); |
| 53 | bool isOngoingMatchcxx . . $ MatchNegotiationState#isOngoingMatch(c9857a73d68e59ba).(void); |
| 54 | bool sentCreateRoomcxx . . $ MatchNegotiationState#sentCreateRoom(c9857a73d68e59ba).(void); |
| 55 | bool sentMatchOffercxx . . $ MatchNegotiationState#sentMatchOffer(c9857a73d68e59ba).(void); |
| 56 | bool twoPassescxx . . $ MatchNegotiationState#twoPasses(c9857a73d68e59ba).(void); |
| 57 | bool countingcxx . . $ MatchNegotiationState#counting(c9857a73d68e59ba).(void); |
| 58 | bool sentDoneCountingcxx . . $ MatchNegotiationState#sentDoneCounting(c9857a73d68e59ba).(void); |
| 59 | bool receivedDoneCountingcxx . . $ MatchNegotiationState#receivedDoneCounting(c9857a73d68e59ba).(void); |
| 60 | bool doneCountingcxx . . $ MatchNegotiationState#doneCounting(c9857a73d68e59ba).(void); |
| 61 | bool sentRematchcxx . . $ MatchNegotiationState#sentRematch(c9857a73d68e59ba).(void); |
| 62 | bool sentRematchAcceptcxx . . $ MatchNegotiationState#sentRematchAccept(c9857a73d68e59ba).(void); |
| 63 | bool sentAdjournResumecxx . . $ MatchNegotiationState#sentAdjournResume(c9857a73d68e59ba).(void); |
| 64 | bool opponentDisconnectedcxx . . $ MatchNegotiationState#opponentDisconnected(c9857a73d68e59ba).(void); |
| 65 | bool opponentRejoiningcxx . . $ MatchNegotiationState#opponentRejoining(c9857a73d68e59ba).(void); |
| 66 | void setupRematchAdjournedcxx . . $ MatchNegotiationState#setupRematchAdjourned(6f89333d9b9322ae).(unsigned short id, QStringcxx . . $ QString# opponent_name); |
| 67 | void resetcxx . . $ MatchNegotiationState#reset(49f6e7a06ebc5aa8).(void); |
| 68 | void sendMatchInvitecxx . . $ MatchNegotiationState#sendMatchInvite(122195e397f39e1b).(PlayerListingcxx . . $ PlayerListing# * p); |
| 69 | void sendMatchAcceptcxx . . $ MatchNegotiationState#sendMatchAccept(122195e397f39e1b).(PlayerListingcxx . . $ PlayerListing# *); |
| 70 | void sendMatchOfferPendingcxx . . $ MatchNegotiationState#sendMatchOfferPending(49f6e7a06ebc5aa8).(void); |
| 71 | void sendCreateRoomcxx . . $ MatchNegotiationState#sendCreateRoom(49f6e7a06ebc5aa8).(void); |
| 72 | void sendJoinRoomcxx . . $ MatchNegotiationState#sendJoinRoom(ed53e3bbd3fa2f69).(unsigned short id); |
| 73 | void createdRoomcxx . . $ MatchNegotiationState#createdRoom(ed53e3bbd3fa2f69).(unsigned short id); |
| 74 | void offerMatchTermscxx . . $ MatchNegotiationState#offerMatchTerms(969a5d62d7a1bd6e).(MatchRequestcxx . . $ MatchRequest# * mr); |
| 75 | void modifyMatchTermscxx . . $ MatchNegotiationState#modifyMatchTerms(969a5d62d7a1bd6e).(MatchRequestcxx . . $ MatchRequest# * mr); |
| 76 | void acceptMatchTermscxx . . $ MatchNegotiationState#acceptMatchTerms(969a5d62d7a1bd6e).(MatchRequestcxx . . $ MatchRequest# * mr); |
| 77 | void startMatchcxx . . $ MatchNegotiationState#startMatch(49f6e7a06ebc5aa8).(void); |
| 78 | void incrementPassescxx . . $ MatchNegotiationState#incrementPasses(49f6e7a06ebc5aa8).(void); |
| 79 | void enterScoreModecxx . . $ MatchNegotiationState#enterScoreMode(49f6e7a06ebc5aa8).(void); |
| 80 | void sendDoneCountingcxx . . $ MatchNegotiationState#sendDoneCounting(49f6e7a06ebc5aa8).(void); |
| 81 | void receiveDoneCountingcxx . . $ MatchNegotiationState#receiveDoneCounting(49f6e7a06ebc5aa8).(void); |
| 82 | void setDoneCountingcxx . . $ MatchNegotiationState#setDoneCounting(49f6e7a06ebc5aa8).(void); |
| 83 | void sendMatchModeRequestcxx . . $ MatchNegotiationState#sendMatchModeRequest(49f6e7a06ebc5aa8).(void); |
| 84 | void sendRematchcxx . . $ MatchNegotiationState#sendRematch(122195e397f39e1b).(PlayerListingcxx . . $ PlayerListing# * p); |
| 85 | void sendRematchAcceptcxx . . $ MatchNegotiationState#sendRematchAccept(49f6e7a06ebc5aa8).(void); |
| 86 | void opponentDisconnectcxx . . $ MatchNegotiationState#opponentDisconnect(49f6e7a06ebc5aa8).(void); |
| 87 | void sendAdjournResumecxx . . $ MatchNegotiationState#sendAdjournResume(49f6e7a06ebc5aa8).(void); |
| 88 | void opponentRejoinscxx . . $ MatchNegotiationState#opponentRejoins(49f6e7a06ebc5aa8).(void); |
| 89 | void opponentReconnectcxx . . $ MatchNegotiationState#opponentReconnect(49f6e7a06ebc5aa8).(void); |
| 90 | void swapColorscxx . . $ MatchNegotiationState#swapColors(49f6e7a06ebc5aa8).(void); |
| 91 | bool verifyPlayercxx . . $ MatchNegotiationState#verifyPlayer(20057ff4c3da74fc).(PlayerListingcxx . . $ PlayerListing# * p); |
| 92 | bool verifyMatchRequestcxx . . $ MatchNegotiationState#verifyMatchRequest(4332f687ff4e837).(MatchRequestcxx . . $ MatchRequest# & mr); |
| 93 | bool verifyGameDatacxx . . $ MatchNegotiationState#verifyGameData(14f5f86f6c435b5).(GameDatacxx . . $ GameData# & g); |
| 94 | bool verifyCountDoneMessagecxx . . $ MatchNegotiationState#verifyCountDoneMessage(3c978dac0e5ee2ad).(unsigned short v); |
| 95 | |
| 96 | private: |
| 97 | enum MSSTATEcxx . . $ MatchNegotiationState#MSSTATE# { MSNONEcxx . . $ MatchNegotiationState#MSNONE., MSINVITEcxx . . $ MatchNegotiationState#MSINVITE., MSACCEPTINVITEcxx . . $ MatchNegotiationState#MSACCEPTINVITE., MSSENTCREATEROOMcxx . . $ MatchNegotiationState#MSSENTCREATEROOM., MSCREATEDROOMcxx . . $ MatchNegotiationState#MSCREATEDROOM., MSJOINEDROOMcxx . . $ MatchNegotiationState#MSJOINEDROOM., |
| 98 | MSMATCHOFFERPENDINGcxx . . $ MatchNegotiationState#MSMATCHOFFERPENDING., |
| 99 | MSMATCHOFFERcxx . . $ MatchNegotiationState#MSMATCHOFFER., MSMATCHMODIFYcxx . . $ MatchNegotiationState#MSMATCHMODIFY., MSMATCHACCEPTcxx . . $ MatchNegotiationState#MSMATCHACCEPT., |
| 100 | MSSTARTMATCHcxx . . $ MatchNegotiationState#MSSTARTMATCH., MSONGOINGMATCHcxx . . $ MatchNegotiationState#MSONGOINGMATCH., |
| 101 | MSONEPASScxx . . $ MatchNegotiationState#MSONEPASS., MSTWOPASScxx . . $ MatchNegotiationState#MSTWOPASS., MSTHREEPASScxx . . $ MatchNegotiationState#MSTHREEPASS., |
| 102 | MSCOUNTINGcxx . . $ MatchNegotiationState#MSCOUNTING., MSSENTDONECOUNTINGcxx . . $ MatchNegotiationState#MSSENTDONECOUNTING., MSRECEIVEDDONECOUNTINGcxx . . $ MatchNegotiationState#MSRECEIVEDDONECOUNTING., MSDONECOUNTINGcxx . . $ MatchNegotiationState#MSDONECOUNTING., |
| 103 | MSMATCHMODEREQUESTcxx . . $ MatchNegotiationState#MSMATCHMODEREQUEST., |
| 104 | MSMATCHFINISHEDcxx . . $ MatchNegotiationState#MSMATCHFINISHED., |
| 105 | MSSENTREMATCHcxx . . $ MatchNegotiationState#MSSENTREMATCH., MSSENTREMATCHACCEPTcxx . . $ MatchNegotiationState#MSSENTREMATCHACCEPT., MSREMATCHcxx . . $ MatchNegotiationState#MSREMATCH., |
| 106 | MSOPPONENTDISCONNECTcxx . . $ MatchNegotiationState#MSOPPONENTDISCONNECT., MSOPPONENTREJOININGcxx . . $ MatchNegotiationState#MSOPPONENTREJOINING., MSSENTADJOURNRESUMEcxx . . $ MatchNegotiationState#MSSENTADJOURNRESUME., MSREMATCHADJOURNEDcxx . . $ MatchNegotiationState#MSREMATCHADJOURNED. } statecxx . . $ MatchNegotiationState#state.; |
| 107 | MSSTATEcxx . . $ MatchNegotiationState#MSSTATE# getStatecxx . . $ MatchNegotiationState#getState(fb510427adb60d0).(void) { return statecxx . . $ MatchNegotiationState#state.; }; |
| 108 | |
| 109 | |
| 110 | PlayerListingcxx . . $ PlayerListing# * playercxx . . $ MatchNegotiationState#player.; |
| 111 | QStringcxx . . $ QString# opponentcxx . . $ MatchNegotiationState#opponent.; |
| 112 | unsigned short game_numbercxx . . $ MatchNegotiationState#game_number.; |
| 113 | |
| 114 | bool negotiation_brokencxx . . $ MatchNegotiationState#negotiation_broken.; |
| 115 | MatchRequestcxx . . $ MatchRequest# * match_requestcxx . . $ MatchNegotiationState#match_request.; |
| 116 | unsigned short counting_verificationcxx . . $ MatchNegotiationState#counting_verification.; |
| 117 | }; |