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 CHESS__STATE_H
12 #define CHESS__STATE_H
14 #include <core/board.h>
15 #include <core/state.h>
16 #include <core/piece.h>
17 #include <core/taguaobject.h>
20 * @brief Namespace holding Chess components.
26 class State
: public IState
{
31 const IBehaviour
* m_behaviour
;
32 const ICastlingRules
* m_castling_rules
;
37 State(const IBehaviour
* behaviour
,
38 const ICastlingRules
* castling
,
41 virtual IState
* clone() const;
45 virtual const Board
* board() const;
46 virtual Board
* board();
48 virtual const IColor
* turn() const;
50 virtual void setTurn(const IColor
* turn
);
52 virtual bool equals(IState
* other
) const;
54 virtual void assign(const IState
* other
);
56 virtual void move(const Move
& move
);
58 virtual TaguaObject
* flags();
59 virtual const TaguaObject
* flags() const;
61 virtual int rank(int n
, const IColor
* turn
) const;
63 virtual const IPoolCollection
* pools() const;
64 virtual IPoolCollection
* pools();
66 virtual const IBehaviour
* behaviour() const;
68 virtual void setDelegator(IState
* delegator
);
70 virtual Point
enPassantTrigger(const Move
& move
) const;
71 virtual Component
* clone(const IBehaviour
* behaviour
,
73 const Point
& size
) const;
78 #endif // CHESS__STATE_H