| 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 | #ifndef MOVE_H |
| 24 | #define MOVE_Hcxx . . $ `src/game_tree/move.h:24:9`! |
| 25 | |
| 26 | #include "defines.h"cxx . . $ `<file>/src/defines.h`/ |
| 27 | |
| 28 | #include <QtCore> |
| 29 | |
| 30 | class Matrixcxx . . $ Matrix#; |
| 31 | |
| 32 | class Movecxx . . $ Move# |
| 33 | { |
| 34 | public: |
| 35 | Movecxx . . $ Move#Move(d4f767463ce0a6b3).(int board_size); |
| 36 | Movecxx . . $ Move#Move(b008f1e121f1e0ed).(StoneColorcxx . . $ StoneColor# c, int mx, int my, int n, GamePhasecxx . . $ GamePhase# phase, const Matrixcxx . . $ Matrix# &mat, bool clearAllMarks=false, const QStringcxx . . $ QString# &s=NULLcxx . . $ QString#QString(85c52e162fed56f9).); |
| 37 | Movecxx . . $ Move#Move(5c1f83d66f14598a).(StoneColorcxx . . $ StoneColor# c, int mx, int my, int n, GamePhasecxx . . $ GamePhase# phase, const QStringcxx . . $ QString# &s=NULLcxx . . $ QString#QString(85c52e162fed56f9).); |
| 38 | Movecxx . . $ Move#Move(752bbe91abdcf632).(Movecxx . . $ Move# *_parent, StoneColorcxx . . $ StoneColor# _c, int _x, int _y); |
| 39 | ~cxx . . $ Move#`~Move`(ced63f7c635d850d).Movecxx . . $ Move#(); |
| 40 | |
| 41 | int getXcxx . . $ Move#getX(455f465bc33b4cdf).() const { return xcxx . . $ Move#x.; } |
| 42 | int getYcxx . . $ Move#getY(455f465bc33b4cdf).() const { return ycxx . . $ Move#y.; } |
| 43 | void setXcxx . . $ Move#setX(d4f767463ce0a6b3).(int n) { xcxx . . $ Move#x. = n; } |
| 44 | void setYcxx . . $ Move#setY(d4f767463ce0a6b3).(int n) { ycxx . . $ Move#y. = n; } |
| 45 | StoneColorcxx . . $ StoneColor# getColorcxx . . $ Move#getColor(6680c74b05d375a4).() const { return stoneColorcxx . . $ Move#stoneColor.; } |
| 46 | void setColorcxx . . $ Move#setColor(42096433316d3db3).(StoneColorcxx . . $ StoneColor# c) { stoneColorcxx . . $ Move#stoneColor. = c; } |
| 47 | int getCapturesBlackcxx . . $ Move#getCapturesBlack(455f465bc33b4cdf).() const { return capturesBlackcxx . . $ Move#capturesBlack.; } |
| 48 | int getCapturesWhitecxx . . $ Move#getCapturesWhite(455f465bc33b4cdf).() const { return capturesWhitecxx . . $ Move#capturesWhite.; } |
| 49 | Matrixcxx . . $ Matrix#* getMatrixcxx . . $ Move#getMatrix(a22259058712982).() { return matrixcxx . . $ Move#matrix.; } |
| 50 | void setMoveNumbercxx . . $ Move#setMoveNumber(d4f767463ce0a6b3).(int n) { moveNumcxx . . $ Move#moveNum. = n; } |
| 51 | int getMoveNumbercxx . . $ Move#getMoveNumber(455f465bc33b4cdf).() const { return moveNumcxx . . $ Move#moveNum.; } |
| 52 | Movecxx . . $ Move# * getLastMovecxx . . $ Move#getLastMove(64a469cb2ad0f61a).(bool followMarker = false); |
| 53 | GamePhasecxx . . $ GamePhase# getGamePhasecxx . . $ Move#getGamePhase(77809a1e68c5b791).() const { return gamePhasecxx . . $ Move#gamePhase.; } |
| 54 | void setGamePhasecxx . . $ Move#setGamePhase(6ad67d8601499648).(GamePhasecxx . . $ GamePhase# p) { gamePhasecxx . . $ Move#gamePhase. = p; } |
| 55 | QStringcxx . . $ QString# &getNodeNamecxx . . $ Move#getNodeName(d436534e89c8f252).() { return nodeNamecxx . . $ Move#nodeName.; } |
| 56 | void setNodeNamecxx . . $ Move#setNodeName(3520e46b33348bf6).(const QStringcxx . . $ QString# &s) { nodeNamecxx . . $ Move#nodeName. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). s; } |
| 57 | QStringcxx . . $ QString# &getCommentcxx . . $ Move#getComment(d436534e89c8f252).() { return commentcxx . . $ Move#comment.; } |
| 58 | void setCommentcxx . . $ Move#setComment(3520e46b33348bf6).(const QStringcxx . . $ QString# &s) { |
| 59 | commentcxx . . $ Move#comment. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). s; |
| 60 | commentcxx . . $ Move#comment..squeezecxx . . $ QString#squeeze(49f6e7a06ebc5aa8).(); |
| 61 | } |
| 62 | QStringcxx . . $ QString# &getUnknownPropertycxx . . $ Move#getUnknownProperty(d436534e89c8f252).() { return unknownPropertycxx . . $ Move#unknownProperty.; } |
| 63 | void setUnknownPropertycxx . . $ Move#setUnknownProperty(3520e46b33348bf6).(const QStringcxx . . $ QString# &s) { unknownPropertycxx . . $ Move#unknownProperty. =cxx . . $ QString#`operator=`(b79fde0b0ce9b948). s; } |
| 64 | const QStringcxx . . $ QString# saveMovecxx . . $ Move#saveMove(8bafd9946dc70e68).(bool isRoot); |
| 65 | bool isTerritoryMarkedcxx . . $ Move#isTerritoryMarked(50ce9a9e25b4a850).() const { return terrMarkedcxx . . $ Move#terrMarked.; } |
| 66 | void setTerritoryMarkedcxx . . $ Move#setTerritoryMarked(b45ddcbc8423892c).(bool b=true) { terrMarkedcxx . . $ Move#terrMarked. = b; } |
| 67 | //void insertFastLoadMark(int x, int y, MarkType markType, const QString &txt=0); |
| 68 | bool isScoredcxx . . $ Move#isScored(50ce9a9e25b4a850).() const { return scoredcxx . . $ Move#scored.; } |
| 69 | void setScorecxx . . $ Move#setScore(5102ef758adc0ae7).(float b, float w) { scoredcxx . . $ Move#scored. = true; scoreBlackcxx . . $ Move#scoreBlack. = b; scoreWhitecxx . . $ Move#scoreWhite. = w; } |
| 70 | void setScoredcxx . . $ Move#setScored(b45ddcbc8423892c).(bool b=true) { scoredcxx . . $ Move#scored. = b; } |
| 71 | float getScoreBlackcxx . . $ Move#getScoreBlack(5036dfe8d4170af2).() const { return scoreBlackcxx . . $ Move#scoreBlack.; } |
| 72 | float getScoreWhitecxx . . $ Move#getScoreWhite(5036dfe8d4170af2).() const { return scoreWhitecxx . . $ Move#scoreWhite.; } |
| 73 | void setOpenMovescxx . . $ Move#setOpenMoves(d4f767463ce0a6b3).(int mv) { openMovescxx . . $ Move#openMoves. = mv; } |
| 74 | int getOpenMovescxx . . $ Move#getOpenMoves(b126dc7c1de90089).() { return openMovescxx . . $ Move#openMoves.; } |
| 75 | void setTimeLeftcxx . . $ Move#setTimeLeft(9364e6e7bff7660).(float time) { timeLeftcxx . . $ Move#timeLeft. = time; } |
| 76 | float getTimeLeftcxx . . $ Move#getTimeLeft(9b8c9e39889c762c).() { return timeLeftcxx . . $ Move#timeLeft.; } |
| 77 | void setTimeinfocxx . . $ Move#setTimeinfo(b45ddcbc8423892c).(bool ti) { timeinfocxx . . $ Move#timeinfo. = ti; } |
| 78 | bool getTimeinfocxx . . $ Move#getTimeinfo(c9857a73d68e59ba).() { return timeinfocxx . . $ Move#timeinfo.; } |
| 79 | // PL[] info: show if stone color keeps equal |
| 80 | void clearPLinfocxx . . $ Move#clearPLinfo(49f6e7a06ebc5aa8).() { PLinfocxx . . $ Move#PLinfo. = false; } |
| 81 | void setPLinfocxx . . $ Move#setPLinfo(42096433316d3db3).(StoneColorcxx . . $ StoneColor# sc) { PLinfocxx . . $ Move#PLinfo. = true; PLnextMovecxx . . $ Move#PLnextMove. = sc; } |
| 82 | bool getPLinfocxx . . $ Move#getPLinfo(c9857a73d68e59ba).() { return PLinfocxx . . $ Move#PLinfo.; } |
| 83 | StoneColorcxx . . $ StoneColor# getPLnextMovecxx . . $ Move#getPLnextMove(5202307a42d70465).() { return PLnextMovecxx . . $ Move#PLnextMove.; } |
| 84 | void setHandicapMovecxx . . $ Move#setHandicapMove(b45ddcbc8423892c).(bool b) { handicapMovecxx . . $ Move#handicapMove. = b; } |
| 85 | bool isHandicapMovecxx . . $ Move#isHandicapMove(c9857a73d68e59ba).() {return handicapMovecxx . . $ Move#handicapMove. ;} |
| 86 | void setNodeIndexcxx . . $ Move#setNodeIndex(d4f767463ce0a6b3).(int i) {nodeIndexcxx . . $ Move#nodeIndex. = i;} |
| 87 | int getNodeIndexcxx . . $ Move#getNodeIndex(b126dc7c1de90089).() {return nodeIndexcxx . . $ Move#nodeIndex.;} |
| 88 | void addBrothercxx . . $ Move#addBrother(490cd2a4f5caa810).(Movecxx . . $ Move# * b); |
| 89 | void addStonecxx . . $ Move#addStone(e6b2860cd25699f2).(StoneColorcxx . . $ StoneColor# c, int x, int y); |
| 90 | |
| 91 | Movecxx . . $ Move# *brothercxx . . $ Move#brother., *soncxx . . $ Move#son., *parentcxx . . $ Move#parent., *markercxx . . $ Move#marker.; |
| 92 | bool checkedcxx . . $ Move#checked.; |
| 93 | //QMap<int,FastLoadMark> *fastLoadMarkDict; |
| 94 | bool isPassMovecxx . . $ Move#isPassMove(c9857a73d68e59ba).(); |
| 95 | |
| 96 | int getNumBrotherscxx . . $ Move#getNumBrothers(b126dc7c1de90089).(); |
| 97 | int getNumSonscxx . . $ Move#getNumSons(b126dc7c1de90089).(); |
| 98 | bool hasParentcxx . . $ Move#hasParent(c9857a73d68e59ba).(); |
| 99 | bool hasPrevBrothercxx . . $ Move#hasPrevBrother(c9857a73d68e59ba).(); |
| 100 | bool hasNextBrothercxx . . $ Move#hasNextBrother(c9857a73d68e59ba).(); |
| 101 | bool checkMoveIsValidcxx . . $ Move#checkMoveIsValid(d30022d4f7f7716f).(StoneColorcxx . . $ StoneColor# c, int x, int y); |
| 102 | bool isInMainBranchcxx . . $ Move#isInMainBranch(50ce9a9e25b4a850).() const; |
| 103 | |
| 104 | Movecxx . . $ Move# *hasSoncxx . . $ Move#hasSon(1b9ccd6dde28afc7).(StoneColorcxx . . $ StoneColor# c, int x, int y); |
| 105 | Movecxx . . $ Move# *getPrevBrothercxx . . $ Move#getPrevBrother(81447a345d48a217).(); |
| 106 | Movecxx . . $ Move# *makeMovecxx . . $ Move#makeMove(b73c42e1a544db20).(StoneColorcxx . . $ StoneColor# c, int x, int y, bool force = false); |
| 107 | Movecxx . . $ Move# *makePasscxx . . $ Move#makePass(81447a345d48a217).(); |
| 108 | |
| 109 | StoneColorcxx . . $ StoneColor# whoIsOnTurncxx . . $ Move#whoIsOnTurn(5202307a42d70465).(); |
| 110 | |
| 111 | private: |
| 112 | StoneColorcxx . . $ StoneColor# stoneColorcxx . . $ Move#stoneColor., PLnextMovecxx . . $ Move#PLnextMove.; |
| 113 | int xcxx . . $ Move#x., ycxx . . $ Move#y., moveNumcxx . . $ Move#moveNum., capturesBlackcxx . . $ Move#capturesBlack., capturesWhitecxx . . $ Move#capturesWhite., openMovescxx . . $ Move#openMoves. , nodeIndexcxx . . $ Move#nodeIndex.; |
| 114 | float scoreBlackcxx . . $ Move#scoreBlack., scoreWhitecxx . . $ Move#scoreWhite.; |
| 115 | float timeLeftcxx . . $ Move#timeLeft.; |
| 116 | Matrixcxx . . $ Matrix# *matrixcxx . . $ Move#matrix.; |
| 117 | GamePhasecxx . . $ GamePhase# gamePhasecxx . . $ Move#gamePhase.; |
| 118 | QStringcxx . . $ QString# commentcxx . . $ Move#comment.; |
| 119 | QStringcxx . . $ QString# unknownPropertycxx . . $ Move#unknownProperty.; |
| 120 | QStringcxx . . $ QString# nodeNamecxx . . $ Move#nodeName.; |
| 121 | bool terrMarkedcxx . . $ Move#terrMarked., scoredcxx . . $ Move#scored., timeinfocxx . . $ Move#timeinfo., PLinfocxx . . $ Move#PLinfo.; |
| 122 | bool handicapMovecxx . . $ Move#handicapMove.; |
| 123 | }; |
| 124 | |
| 125 | #endif |