2 Copyright (c) 2007 Paolo Capriotti <p.capriotti@gmail.com>
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
10 #include "defaultpolicy.h"
15 InteractionType
DefaultPolicy::movable(const IState
* state
,
17 const Point
& p
) const {
18 Piece piece
= state
->board()->get(p
);
19 if (piece
== Piece() || !test(piece
.color()))
22 return piece
.color() == state
->turn() ? Moving
: Premoving
;
25 InteractionType
DefaultPolicy::droppable(const IState
* state
,
27 const IColor
* pool
) const {
31 return pool
== state
->turn() ? Moving
: Premoving
;