ICSAPI::parseVerbose is now used instead of VariantInfo::getVerboseMove.
[tagua/yd.git] / src / variants / xchess / move.h
blob165d99fa7f45b6ab1437af390b7f56dda392c011
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 MOVE_H
12 #define MOVE_H
14 #include "point.h"
15 #include "piecetype.h"
16 #include "moveserializer.h"
19 class ChessMove {
20 public:
21 enum Type {
22 Invalid = 0,
23 Normal,
24 EnPassantCapture,
25 EnPassantTrigger,
26 KingSideCastling,
27 QueenSideCastling,
28 Promotion
30 Type m_type;
31 public:
32 enum Status {
33 Untested,
34 Legal,
35 Illegal
37 Point from, to;
38 PieceType promotionType;
39 Status status;
40 Type type() const { return m_type; }
41 void setType(Type value) { m_type = value; }
43 QString promotionSymbol() const;
45 ChessMove(Point from, Point to, PieceType promotionType = INVALID_TYPE);
46 ChessMove();
48 static ChessMove invalid() { return ChessMove(Point::invalid(), Point::invalid()); }
49 inline bool valid() const { return from != Point::invalid() && to != Point::invalid(); }
50 QString toString(int xsize, int ysize) const;
51 bool operator==(const ChessMove& other) const;
52 bool operator!=(const ChessMove& other) const;
54 static ChessMove createDropMove(int pool, int piece_index, const Point&);
57 #endif // MOVE_H