Add san() to the MoveSerializer interface, so other variants can call it.
[tagua/yd.git] / src / usermove.h
blob0e172cbd6643065574c1faf0e7646332c9e6fc25
1 /*
2 Copyright (c) 2006 Paolo Capriotti <p.capriotti@gmail.com>
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 USERMOVE_H
12 #define USERMOVE_H
14 #include <boost/shared_ptr.hpp>
15 #include <core/point.h>
17 struct NormalUserMove {
18 Point from;
19 Point to;
20 int promotionType;
22 NormalUserMove(const Point& from, const Point& to)
23 : from(from)
24 , to(to)
25 , promotionType(-1) { }
27 bool valid() const {
28 return from != Point::invalid() && to != Point::invalid();
32 struct DropUserMove {
33 int pool;
34 int piece_index;
35 Point to;
37 DropUserMove(int pool, int piece_index, const Point& to)
38 : pool(pool)
39 , piece_index(piece_index)
40 , to(to) { }
43 #endif //USERMOVE_H