Variants are not singletons anymore.
[tagua/yd.git] / src / positioninfo.h
blobbd54a8cd2c6377b1e69c186030b106c6a96db1f7
1 /*
2 Copyright (c) 2006 Paolo Capriotti <p.capriotti@sns.it>
3 (c) 2006 Maurizio Monge <maurizio.monge@kdemail.net>
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9 */
11 #ifndef POSITIONINFO_H
12 #define POSITIONINFO_H
14 #include <vector>
15 #include <map>
16 #include <boost/shared_ptr.hpp>
17 #include <QRegExp>
19 #include "tagua.h"
20 #include "icsgamedata.h"
21 #include "fwd.h"
23 class PositionInfo {
24 public:
25 enum Relation {
26 MoveListStart = -4,
27 IsolatedPosition = -3,
28 ObservingExamined = -2,
29 NotMyMove = -1,
30 ObservingPlayed = 0,
31 MyMove = 1,
32 Examining = 2,
33 UnknownRelation = -255
36 class CaptureIndexes {
37 public:
38 enum {
39 ChessboardStart = 1,
40 Turn = 9,
41 EnPassant = 10,
42 WhiteKingCastle = 11,
43 WhiteQueenCastle = 12,
44 BlackKingCastle = 13,
45 BlackQueenCastle = 14,
46 ReversibleMoves = 15,
47 GameNumber = 16,
48 WhitePlayer = 17,
49 BlackPlayer = 18,
50 Relation = 19,
51 StartingTime = 20,
52 StartingIncrement = 21,
53 WhiteTime = 24,
54 BlackTime = 25,
55 MoveOrdinal = 26,
56 LastMoveVerbose = 27,
57 TimeUsed = 28,
58 LastMove = 29,
59 Flip = 30
63 class PositionRow {
64 public:
65 std::vector<AbstractPiece::Ptr> row;
66 explicit PositionRow(const ICSAPIPtr& icsapi, const QString& str);
69 static QRegExp pattern;
71 bool valid;
72 PositionInfo(const std::map<int, ICSGameData>& games, const QString&);
74 int turn;
75 int moveIndex;
76 int index() const;
77 int gameNumber;
78 QString whitePlayer;
79 QString blackPlayer;
80 AbstractPosition::Ptr position;
81 Point enPassantSquare;
83 Relation relation;
85 QString lastMoveSAN;
86 QString lastMove;
87 int whiteTime;
88 int blackTime;
91 #endif // POSITIONINFO_H