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.
16 ChessMove::ChessMove(Point from
, Point to
, PieceType promotionType
)
19 , promotionType(promotionType
)
22 ChessMove::ChessMove()
24 , promotionType(INVALID_TYPE
)
27 QString
ChessMove::promotionSymbol() const {
28 return ChessPiece::typeSymbol(promotionType
);
31 QString
ChessMove::toString(int ysize
) const {
32 QString res
= from
.toString(ysize
) + to
.toString(ysize
);
33 if (m_type
== Promotion
)
34 res
= res
+ "=" + promotionSymbol();
39 bool ChessMove::operator==(const ChessMove
& other
) const {
40 return from
== other
.from
42 && promotionType
== other
.promotionType
;
45 bool ChessMove::operator!=(const ChessMove
& other
) const {
46 return !operator==(other
);
49 ChessMove
ChessMove::createDropMove(int pool
, int piece_index
, const Point
&) {