push 98438d20051787465e7a05f4aa66ab452afb1c14
[tagua/yd.git] / src / variants / chess / validator.h
blob5b2b5081ac1e2e4c368b013e60787a86471ee6b8
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 CHESS__VALIDATOR_H
12 #define CHESS__VALIDATOR_H
14 #include <core/component.h>
15 #include <core/validator.h>
17 namespace Chess {
19 class Validator : public Component, public IValidator {
20 Q_OBJECT
21 IValidator* m_delegator;
22 public:
23 Validator();
25 virtual bool pseudolegal(const IState* state, Move& move) const;
27 virtual bool legal(const IState* state, Move& move) const;
29 virtual bool attacks(const IState* state, const IColor* player,
30 const Point& square, const Piece& target = Piece()) const;
32 virtual const IColor* mover(const IState* state, const Move& move) const;
34 virtual void setDelegator(IValidator* validator);
39 #endif // CHESS__VALIDATOR_H