~ubuntu-branches/ubuntu/raring/qgo/raring

« back to all changes in this revision

Viewing changes to src/move.h

  • Committer: Bazaar Package Importer
  • Author(s): Martin A. Godisch
  • Date: 2005-01-01 23:07:10 UTC
  • Revision ID: james.westby@ubuntu.com-20050101230710-fhng6yidm47xlb2i
Tags: upstream-1.0.0-r2
ImportĀ upstreamĀ versionĀ 1.0.0-r2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
* move.h
 
3
*/
 
4
 
 
5
#ifndef MOVE_H
 
6
#define MOVE_H
 
7
 
 
8
#include "globals.h"
 
9
#include <qstring.h>
 
10
#include <qintdict.h>
 
11
 
 
12
class Matrix;
 
13
 
 
14
class Move
 
15
{
 
16
public:
 
17
        Move(int board_size);
 
18
        Move(StoneColor c, int mx, int my, int n, GameMode mode, const Matrix &mat, const QString &s=NULL);
 
19
        Move(StoneColor c, int mx, int my, int n, GameMode mode, const QString &s=NULL);
 
20
        ~Move();
 
21
        
 
22
        bool equals(Move *m);
 
23
        int getX() const { return x; }
 
24
        int getY() const { return y; }
 
25
        void setX(int n) { x = n; }
 
26
        void setY(int n) { y = n; }
 
27
        StoneColor getColor() const { return stoneColor; }
 
28
        void setColor(StoneColor c) { stoneColor = c; }
 
29
        int getCapturesBlack() const { return capturesBlack; }
 
30
        int getCapturesWhite() const { return capturesWhite; }
 
31
        void setCaptures(int cb, int cw) { capturesBlack = cb; capturesWhite = cw; }
 
32
        Matrix* getMatrix() { return matrix; }
 
33
        void setMatrix(Matrix *m) { matrix = m; }
 
34
        void setMoveNumber(int n) { moveNum = n; }
 
35
        int getMoveNumber() const { return moveNum; }
 
36
        GameMode getGameMode() const { return gameMode; }
 
37
        void setGameMode(GameMode m) { gameMode = m; }
 
38
        QString &getNodeName() { return nodeName; }
 
39
        void setNodeName(const QString &s) { nodeName = s; }
 
40
        QString &getComment() { return comment; }
 
41
        void setComment(const QString &s) {
 
42
                comment = s;
 
43
#if (QT_VERSION >= 0x030200)
 
44
                comment.squeeze();
 
45
#endif
 
46
 
 
47
}
 
48
        QString &getUnknownProperty() { return unknownProperty; }
 
49
        void setUnknownProperty(const QString &s) { unknownProperty = s; }
 
50
        const QString saveMove(bool isRoot);
 
51
        bool isTerritoryMarked() const { return terrMarked; }
 
52
        void setTerritoryMarked(bool b=true) { terrMarked = b; }
 
53
        void insertFastLoadMark(int x, int y, MarkType markType, const QString &txt=0);
 
54
        bool isScored() const { return scored; }
 
55
        void setScore(float b, float w) { scored = true; scoreBlack = b; scoreWhite = w; }
 
56
        void setScored(bool b=true) { scored = b; }
 
57
        float getScoreBlack() const { return scoreBlack; }
 
58
        float getScoreWhite() const { return scoreWhite; }
 
59
        void setOpenMoves(int mv) { openMoves = mv; }
 
60
        int getOpenMoves() { return openMoves; }
 
61
        void setTimeLeft(float time) { timeLeft = time; }
 
62
        float getTimeLeft() { return timeLeft; }
 
63
        void setTimeinfo(bool ti) { timeinfo = ti; }
 
64
        bool getTimeinfo() { return timeinfo; }
 
65
        // PL[] info: show if stone color keeps equal
 
66
        void clearPLinfo() { PLinfo = false; }
 
67
        void setPLinfo(StoneColor sc) { PLinfo = true; PLnextMove = sc; }
 
68
        bool getPLinfo() { return PLinfo; }
 
69
        StoneColor getPLnextMove() { return PLnextMove; }
 
70
        
 
71
        Move *brother, *son, *parent, *marker;
 
72
        bool checked;
 
73
        QIntDict<FastLoadMark> *fastLoadMarkDict;
 
74
  bool isPassMove();
 
75
 
 
76
  
 
77
private:
 
78
        StoneColor stoneColor, PLnextMove;
 
79
        int x, y, moveNum, capturesBlack, capturesWhite, openMoves;
 
80
        float scoreBlack, scoreWhite;
 
81
        float timeLeft;
 
82
        Matrix *matrix;
 
83
        GameMode gameMode;
 
84
        QString comment;
 
85
        QString unknownProperty;
 
86
        QString nodeName;
 
87
        bool terrMarked, scored, timeinfo, PLinfo;
 
88
};
 
89
 
 
90
#endif