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/component.h>
16 #include <core/state.h>
17 #include <core/piece.h>
18 #include <core/taguaobject.h>
24 class State
: public Component
, public IState
{
29 const IBehaviour
* m_behaviour
;
30 const ICastlingRules
* m_castling_rules
;
35 State(const IBehaviour
* behaviour
,
36 const ICastlingRules
* castling
,
39 virtual IState
* clone() const;
43 virtual const Board
* board() const;
44 virtual Board
* board();
46 virtual const IColor
* turn() const;
48 virtual void setTurn(const IColor
* turn
);
50 virtual bool equals(IState
* other
) const;
52 virtual void assign(const IState
* other
);
54 virtual void move(const Move
& move
);
56 virtual TaguaObject
* flags();
57 virtual const TaguaObject
* flags() const;
59 virtual int rank(int n
, const IColor
* turn
) const;
61 virtual const IPoolCollection
* pools() const;
62 virtual IPoolCollection
* pools();
64 virtual const IBehaviour
* behaviour() const;
66 virtual void setDelegator(IState
* delegator
);
68 virtual Point
enPassantTrigger(const Move
& move
) const;
69 virtual Component
* clone(const IBehaviour
* behaviour
,
71 const Point
& size
) const;
76 #endif // CHESS__STATE_H