4e591bce9b7d3590cdf6b5aa5dd02c472d345cd6
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>
21 * @brief Namespace holding Chess components.
27 class State
: public Component
, public IState
{
32 const IBehaviour
* m_behaviour
;
33 const ICastlingRules
* m_castling_rules
;
38 State(const IBehaviour
* behaviour
,
39 const ICastlingRules
* castling
,
42 virtual IState
* clone() const;
46 virtual const Board
* board() const;
47 virtual Board
* board();
49 virtual const IColor
* turn() const;
51 virtual void setTurn(const IColor
* turn
);
53 virtual bool equals(IState
* other
) const;
55 virtual void assign(const IState
* other
);
57 virtual void move(const Move
& move
);
59 virtual TaguaObject
* flags();
60 virtual const TaguaObject
* flags() const;
62 virtual int rank(int n
, const IColor
* turn
) const;
64 virtual const IPoolCollection
* pools() const;
65 virtual IPoolCollection
* pools();
67 virtual const IBehaviour
* behaviour() const;
69 virtual void setDelegator(IState
* delegator
);
71 virtual Point
enPassantTrigger(const Move
& move
) const;
72 virtual Component
* clone(const IBehaviour
* behaviour
,
74 const Point
& size
) const;
79 #endif // CHESS__STATE_H