new 4475edb243ed4627f4c5f2c470ca40b3def034d4
[tagua/yd.git] / src / variants / shogi / validator.h
blob6281cd8d71d95df22d186fe61425104684a6e425
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 SHOGI__VALIDATOR_H
12 #define SHOGI__VALIDATOR_H
14 #include <core/component.h>
15 #include <core/validator.h>
17 namespace Shogi {
19 class Validator : public Component, public IValidator {
20 Q_OBJECT
21 IValidator* m_delegator;
22 protected:
23 virtual bool stuckPiece(const IState* state,
24 const Piece& piece, const Point& p) const;
25 public:
26 Validator();
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