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 SHOGI__STATE_H
12 #define SHOGI__STATE_H
14 #include <core/board.h>
15 #include <core/component.h>
16 #include <core/defaultstate.h>
17 #include <core/piece.h>
18 #include <core/taguaobject.h>
21 * @brief Namespace holding Shogi components.
25 class State
: public Component
, public DefaultState
{
30 const IBehaviour
* m_behaviour
;
32 IPoolCollection
* m_pools
;
36 State(const IBehaviour
* behaviour
,
40 virtual IState
* clone() const;
44 virtual const Board
* board() const;
45 virtual Board
* board();
47 virtual const IColor
* turn() const;
49 virtual void setTurn(const IColor
* turn
);
51 virtual bool equals(IState
* other
) const;
53 virtual void assign(const IState
* other
);
55 virtual void move(const Move
& move
);
57 virtual TaguaObject
* flags();
58 virtual const TaguaObject
* flags() const;
60 virtual int rank(int n
, const IColor
* turn
) const;
62 virtual const IPoolCollection
* pools() const;
63 virtual IPoolCollection
* pools();
65 virtual const IBehaviour
* behaviour() const;
67 virtual void setDelegator(IState
* delegator
);
69 virtual Component
* clone(const IBehaviour
* behaviour
,
70 const Point
& size
) const;
75 #endif // SHOGI__STATE_H