Initial porting to the new component API.
[tagua/yd.git] / src / core / move.h
blob420ab1e44886ebe2436d09545e81ff139d6f1276
1 /*
2 Copyright (c) 2007 Paolo Capriotti <p.capriotti@gmail.com>
3 (c) 2007 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 CORE__MOVE_H
12 #define CORE__MOVE_H
14 #include <QMetaType>
15 #include "taguaobject.h"
16 #include "point.h"
17 #include "piece.h"
19 class TAGUA_EXPORT Move : public TaguaObject {
20 Point m_src;
21 Point m_dst;
22 const IType* m_promotion;
24 // for drops
25 const IColor* m_pool;
26 int m_index;
27 Piece m_drop;
29 QString m_type;
30 public:
31 Move();
32 Move(const Point& src, const Point& dst, IType* promotion = 0);
33 Move(const IColor* pool, int index, const Point& dst);
35 Point src() const;
36 Point dst() const;
37 Piece drop() const;
38 void setDrop(const Piece& piece);
39 Point delta() const;
41 QString type() const;
42 void setType(const QString&);
44 const IType* promotion() const;
45 void setPromotion(const IType* promotion);
47 bool isDrop() const;
49 const IColor* pool() const;
50 int index() const;
52 bool operator==(const Move& mv) const;
53 bool operator!=(const Move& mv) const;
56 Q_DECLARE_METATYPE(Move)
58 #endif // CORE__MOVE_H