| 1 | /*************************************************************************** |
| 2 | qgtp.h - description |
| 3 | ------------------- |
| 4 | begin : Thu Nov 29 2001 |
| 5 | copyright : (C) 2001 by PALM Thomas , DINTILHAC Florian, HIVERT Anthony, PIOC Sebastien |
| 6 | email : |
| 7 | ***************************************************************************/ |
| 8 | |
| 9 | /*************************************************************************** |
| 10 | * * |
| 11 | * This program is free software; you can redistribute it and/or modify * |
| 12 | * it under the terms of the GNU General Public License as published by * |
| 13 | * the Free Software Foundation; either version 2 of the License, or * |
| 14 | * (at your option) any later version. * |
| 15 | * * |
| 16 | ***************************************************************************/ |
| 17 | |
| 18 | #ifndef QGTP_H |
| 19 | #define QGTP_Hcxx . . $ `src/gtp/qgtp.h:19:9`! |
| 20 | |
| 21 | #include <QProcess> |
| 22 | #include <QList> |
| 23 | |
| 24 | #define IGTP_BUFSIZEcxx . . $ `src/gtp/qgtp.h:24:9`! 2048 /* Size of the response buffer */ |
| 25 | #define OKcxx . . $ `src/gtp/qgtp.h:25:9`! 0 |
| 26 | #define FAILcxx . . $ `src/gtp/qgtp.h:26:9`! -1 |
| 27 | |
| 28 | |
| 29 | /** |
| 30 | *@author PALM Thomas , DINTILHAC Florian, HIVERT Anthony, PIOC Sebastien |
| 31 | */ |
| 32 | |
| 33 | struct Pointcxx . . $ Point# |
| 34 | { |
| 35 | Pointcxx . . $ Point#Point(f2aedcda44a3e977).(char _x, char _y) : xcxx . . $ Point#x.(_x), ycxx . . $ Point#y.(_y) {} |
| 36 | char xcxx . . $ Point#x.,ycxx . . $ Point#y.; |
| 37 | }; |
| 38 | |
| 39 | class QGtpcxx . . $ QGtp# : public QObjectcxx . . $ QObject#{ |
| 40 | Q_OBJECTcxx . . $ `<external>/1208926524888476972/qobjectdefs.h:170:9`! |
| 41 | |
| 42 | signalscxx . . $ `<external>/1208926524888476972/qobjectdefs.h:89:14`!: |
| 43 | void signal_computerPlayedcxx . . $ QGtp#signal_computerPlayed(3e454b8ccf442868).( int, int ); |
| 44 | void computerResignedcxx . . $ QGtp#computerResigned(49f6e7a06ebc5aa8).(); |
| 45 | void computerPassedcxx . . $ QGtp#computerPassed(49f6e7a06ebc5aa8).(); |
| 46 | |
| 47 | public: |
| 48 | void slot_readFromStdoutcxx . . $ QGtp#slot_readFromStdout(49f6e7a06ebc5aa8).(); |
| 49 | void slot_processExitedcxx . . $ QGtp#slot_processExited(15c350e1a5203cbf).(int , QProcesscxx . . $ QProcess#::ExitStatuscxx . . $ QProcess#ExitStatus# ); |
| 50 | |
| 51 | QGtpcxx . . $ QGtp#QGtp(49f6e7a06ebc5aa8).(); |
| 52 | ~cxx . . $ QGtp#`~QGtp`(ced63f7c635d850d).QGtpcxx . . $ QGtp#(); |
| 53 | |
| 54 | bool isBusycxx . . $ QGtp#isBusy(c9857a73d68e59ba).() { return busycxx . . $ QGtp#busy.; } |
| 55 | |
| 56 | /**************************** |
| 57 | * * |
| 58 | ****************************/ |
| 59 | QStringcxx . . $ QString# getLastMessagecxx . . $ QGtp#getLastMessage(4365c3963150523e).(); |
| 60 | int openGtpSessioncxx . . $ QGtp#openGtpSession(18a8b0c0b3bf543a).(QStringcxx . . $ QString# path, QStringcxx . . $ QString# args, int size, float komi, int handicap); |
| 61 | QProcesscxx . . $ QProcess# * programProcesscxx . . $ QGtp#programProcess. ; |
| 62 | void fflushcxx . . $ QGtp#fflush(ddc4016aa177531b).(QByteArraycxx . . $ QByteArray# s); |
| 63 | |
| 64 | /**************************** |
| 65 | * Administrative commands. * |
| 66 | ****************************/ |
| 67 | int quitcxx . . $ QGtp#quit(b126dc7c1de90089). (); |
| 68 | |
| 69 | /**************************** |
| 70 | * Program identity. * |
| 71 | ****************************/ |
| 72 | int namecxx . . $ QGtp#name(b126dc7c1de90089). (); |
| 73 | int protocolVersioncxx . . $ QGtp#protocolVersion(b126dc7c1de90089). (); |
| 74 | int versioncxx . . $ QGtp#version(b126dc7c1de90089). (); |
| 75 | |
| 76 | /*************************** |
| 77 | * Setting the board size. * |
| 78 | ***************************/ |
| 79 | int setBoardsizecxx . . $ QGtp#setBoardsize(7864480464b09eea). (int size); |
| 80 | int queryBoardsizecxx . . $ QGtp#queryBoardsize(b126dc7c1de90089).(); |
| 81 | |
| 82 | /*************************** |
| 83 | * Clearing the board. * |
| 84 | ***************************/ |
| 85 | int clearBoardcxx . . $ QGtp#clearBoard(b126dc7c1de90089). (); |
| 86 | |
| 87 | /************ |
| 88 | * Setting. * |
| 89 | ************/ |
| 90 | int setKomicxx . . $ QGtp#setKomi(1bb0578f3efdc255). (float k); |
| 91 | int setLevelcxx . . $ QGtp#setLevel(7864480464b09eea). (int level); |
| 92 | |
| 93 | /****************** |
| 94 | * Playing moves. * |
| 95 | ******************/ |
| 96 | int playblackcxx . . $ QGtp#playblack(9b79fb6aee4c0440). (int x, int y); |
| 97 | int playblackPasscxx . . $ QGtp#playblackPass(b126dc7c1de90089). (); |
| 98 | int playwhitecxx . . $ QGtp#playwhite(9b79fb6aee4c0440). (int x, int y); |
| 99 | int playwhitePasscxx . . $ QGtp#playwhitePass(b126dc7c1de90089). (); |
| 100 | int fixedHandicapcxx . . $ QGtp#fixedHandicap(7864480464b09eea). (int handicap); |
| 101 | int set_free_handicapcxx . . $ QGtp#set_free_handicap(c73e7c52a16cf11a). (QListcxx . . $ QList#<Pointcxx . . $ Point#> handicap_stones); |
| 102 | int loadsgfcxx . . $ QGtp#loadsgf(ee4ca58270b3874e). (QStringcxx . . $ QString# filename,int movNumber=0,char c='A',int i=0); |
| 103 | |
| 104 | /***************** |
| 105 | * Board status. * |
| 106 | *****************/ |
| 107 | int whatColorcxx . . $ QGtp#whatColor(f47ee98913c22bd1). (char c, int j); |
| 108 | int countlibcxx . . $ QGtp#countlib(f47ee98913c22bd1). (char c, int j); |
| 109 | int findlibcxx . . $ QGtp#findlib(f47ee98913c22bd1). (char c, int j); |
| 110 | int isLegalcxx . . $ QGtp#isLegal(2de9b7c1be362fba). (QStringcxx . . $ QString# color, char c, int j); |
| 111 | int allLegalcxx . . $ QGtp#allLegal(87a9b7c6fe1ccdba). (QStringcxx . . $ QString# color); |
| 112 | int capturescxx . . $ QGtp#captures(87a9b7c6fe1ccdba). (QStringcxx . . $ QString# color); |
| 113 | |
| 114 | /********************** |
| 115 | * Retractable moves. * |
| 116 | **********************/ |
| 117 | int trymovecxx . . $ QGtp#trymove(2de9b7c1be362fba). (QStringcxx . . $ QString# color, char c, int j); |
| 118 | int popgocxx . . $ QGtp#popgo(b126dc7c1de90089). (); |
| 119 | |
| 120 | /********************* |
| 121 | * Tactical reading. * |
| 122 | *********************/ |
| 123 | int attackcxx . . $ QGtp#attack(f47ee98913c22bd1). (char c, int j); |
| 124 | int defendcxx . . $ QGtp#defend(f47ee98913c22bd1). (char c, int j); |
| 125 | int increaseDepthscxx . . $ QGtp#increaseDepths(b126dc7c1de90089). (); |
| 126 | int decreaseDepthscxx . . $ QGtp#decreaseDepths(b126dc7c1de90089). (); |
| 127 | |
| 128 | /****************** |
| 129 | * owl reading. * |
| 130 | ******************/ |
| 131 | int owlAttackcxx . . $ QGtp#owlAttack(f47ee98913c22bd1). (char c, int j); |
| 132 | int owlDefendcxx . . $ QGtp#owlDefend(f47ee98913c22bd1). (char c, int j); |
| 133 | |
| 134 | /******** |
| 135 | * eyes * |
| 136 | ********/ |
| 137 | int evalEyecxx . . $ QGtp#evalEye(f47ee98913c22bd1). (char c, int j); |
| 138 | |
| 139 | /***************** |
| 140 | * dragon status * |
| 141 | *****************/ |
| 142 | int dragonStatuscxx . . $ QGtp#dragonStatus(f47ee98913c22bd1). (char c, int j); |
| 143 | int sameDragoncxx . . $ QGtp#sameDragon(24f15965b831f2f8). (char c1, int i1, char c2, int i2); |
| 144 | int dragonDatacxx . . $ QGtp#dragonData(b126dc7c1de90089). (); |
| 145 | int dragonDatacxx . . $ QGtp#dragonData(f47ee98913c22bd1). (char c, int i); |
| 146 | |
| 147 | /*********************** |
| 148 | * combination attacks * |
| 149 | ***********************/ |
| 150 | int combinationAttackcxx . . $ QGtp#combinationAttack(87a9b7c6fe1ccdba). (QStringcxx . . $ QString# color); |
| 151 | |
| 152 | /******************** |
| 153 | * generating moves * |
| 154 | ********************/ |
| 155 | int genmoveBlackcxx . . $ QGtp#genmoveBlack(b126dc7c1de90089). (); |
| 156 | int genmoveWhitecxx . . $ QGtp#genmoveWhite(b126dc7c1de90089). (); |
| 157 | int genmovecxx . . $ QGtp#genmove(60e26aecde23a425). (QStringcxx . . $ QString# color,int seed=0); |
| 158 | int topMovesBlackcxx . . $ QGtp#topMovesBlack(b126dc7c1de90089). (); |
| 159 | int topMovesWhitecxx . . $ QGtp#topMovesWhite(b126dc7c1de90089). (); |
| 160 | int undocxx . . $ QGtp#undo(7864480464b09eea). (int i=1); |
| 161 | int finalStatuscxx . . $ QGtp#finalStatus(9e9bcf41842a210f). (char c, int i, int seed=0); |
| 162 | int finalStatusListcxx . . $ QGtp#finalStatusList(60e26aecde23a425). (QStringcxx . . $ QString# status, int seed=0); |
| 163 | |
| 164 | /************** |
| 165 | * score * |
| 166 | **************/ |
| 167 | int finalScorecxx . . $ QGtp#finalScore(7864480464b09eea). (int seed=0); |
| 168 | int estimateScorecxx . . $ QGtp#estimateScore(b126dc7c1de90089). (); |
| 169 | int newScorecxx . . $ QGtp#newScore(b126dc7c1de90089). (); |
| 170 | |
| 171 | /************** |
| 172 | * statistics * |
| 173 | **************/ |
| 174 | int getLifeNodeCountercxx . . $ QGtp#getLifeNodeCounter(b126dc7c1de90089). (); |
| 175 | int getOwlNodeCountercxx . . $ QGtp#getOwlNodeCounter(b126dc7c1de90089). (); |
| 176 | int getReadingNodeCountercxx . . $ QGtp#getReadingNodeCounter(b126dc7c1de90089). (); |
| 177 | int getTrymoveCountercxx . . $ QGtp#getTrymoveCounter(b126dc7c1de90089). (); |
| 178 | int resetLifeNodeCountercxx . . $ QGtp#resetLifeNodeCounter(b126dc7c1de90089). (); |
| 179 | int resetOwlNodeCountercxx . . $ QGtp#resetOwlNodeCounter(b126dc7c1de90089). (); |
| 180 | int resetReadingNodeCountercxx . . $ QGtp#resetReadingNodeCounter(b126dc7c1de90089). (); |
| 181 | int resetTrymoveCountercxx . . $ QGtp#resetTrymoveCounter(b126dc7c1de90089). (); |
| 182 | |
| 183 | /********* |
| 184 | * debug * |
| 185 | *********/ |
| 186 | int showboardcxx . . $ QGtp#showboard(b126dc7c1de90089). (); |
| 187 | int dumpStackcxx . . $ QGtp#dumpStack(b126dc7c1de90089). (); |
| 188 | int debugInfluencecxx . . $ QGtp#debugInfluence(cf8c7f074bbf9512). (QStringcxx . . $ QString# color, QStringcxx . . $ QString# list); |
| 189 | int debugMoveInfluencecxx . . $ QGtp#debugMoveInfluence(d6dcd0014ed33d8b). (QStringcxx . . $ QString# color, char c, int i, QStringcxx . . $ QString# list); |
| 190 | int influencecxx . . $ QGtp#influence(87a9b7c6fe1ccdba). (QStringcxx . . $ QString# color); |
| 191 | int moveInfluencecxx . . $ QGtp#moveInfluence(2de9b7c1be362fba). (QStringcxx . . $ QString# color, char c, int i); |
| 192 | int wormCutstonecxx . . $ QGtp#wormCutstone(f47ee98913c22bd1). (char c, int i); |
| 193 | int wormDatacxx . . $ QGtp#wormData(b126dc7c1de90089). (); |
| 194 | int wormDatacxx . . $ QGtp#wormData(f47ee98913c22bd1). (char c, int i); |
| 195 | int wormStonescxx . . $ QGtp#wormStones(b126dc7c1de90089). (); |
| 196 | int tuneMoveOrderingcxx . . $ QGtp#tuneMoveOrdering(7864480464b09eea). (int MOVE_ORDERING_PARAMETERS); |
| 197 | int echocxx . . $ QGtp#echo(87a9b7c6fe1ccdba). (QStringcxx . . $ QString# param); |
| 198 | int helpcxx . . $ QGtp#help(b126dc7c1de90089). (); |
| 199 | int reportUncertaintycxx . . $ QGtp#reportUncertainty(87a9b7c6fe1ccdba). (QStringcxx . . $ QString# s); |
| 200 | int shellcxx . . $ QGtp#shell(87a9b7c6fe1ccdba).(QStringcxx . . $ QString# s); |
| 201 | int knownCommandcxx . . $ QGtp#knownCommand(87a9b7c6fe1ccdba).(QStringcxx . . $ QString# s); |
| 202 | |
| 203 | private : |
| 204 | QByteArraycxx . . $ QByteArray# encodeCoorscxx . . $ QGtp#encodeCoors(4869bc8897d11479).(int x, int y); |
| 205 | QByteArraycxx . . $ QByteArray# intToQByteArraycxx . . $ QGtp#intToQByteArray(85265d60c2bde7db).(int i); |
| 206 | |
| 207 | int _cptcxx . . $ QGtp#_cpt.; /* Number of the request */ |
| 208 | char *_outFilecxx . . $ QGtp#_outFile.; |
| 209 | char *outFilecxx . . $ QGtp#outFile.; |
| 210 | FILEcxx . . $ FILE# *_inFilecxx . . $ QGtp#_inFile.; |
| 211 | QStringcxx . . $ QString# _responsecxx . . $ QGtp#_response., answercxx . . $ QGtp#answer.; |
| 212 | QListcxx . . $ QList#<int> moveRequestscxx . . $ QGtp#moveRequests.; |
| 213 | |
| 214 | int waitResponsecxx . . $ QGtp#waitResponse(b126dc7c1de90089).(); |
| 215 | |
| 216 | bool responseReceivedcxx . . $ QGtp#responseReceived.,issueCmdNbcxx . . $ QGtp#issueCmdNb. ; |
| 217 | |
| 218 | bool busycxx . . $ QGtp#busy.; |
| 219 | }; |
| 220 | |
| 221 | |
| 222 | |
| 223 | |
| 224 | #endif |