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.
11 #ifndef SHOGI__VALIDATOR_H
12 #define SHOGI__VALIDATOR_H
14 #include <core/component.h>
15 #include <core/validator.h>
19 class Validator
: public Component
, public IValidator
{
21 IValidator
* m_delegator
;
23 virtual bool stuckPiece(const IState
* state
,
24 const Piece
& piece
, const Point
& p
) const;
28 virtual bool pseudolegal(const IState
* state
, Move
& move
) const;
30 virtual bool legal(const IState
* state
, Move
& move
) const;
32 virtual bool attacks(const IState
* state
, const IColor
* player
,
33 const Point
& square
, const Piece
& target
= Piece()) const;
35 virtual const IColor
* mover(const IState
* state
, const Move
& move
) const;
37 virtual void setDelegator(IValidator
* validator
);
42 #endif // SHOGI__VALIDATOR_H