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/state.h>
17 #include <core/piece.h>
18 #include <core/taguaobject.h>
22 class State
: public Component
, public IState
{
27 const IBehaviour
* m_behaviour
;
29 IPoolCollection
* m_pools
;
33 State(const IBehaviour
* behaviour
,
37 virtual IState
* clone() const;
41 virtual const Board
* board() const;
42 virtual Board
* board();
44 virtual const IColor
* turn() const;
46 virtual void setTurn(const IColor
* turn
);
48 virtual bool equals(IState
* other
) const;
50 virtual void assign(const IState
* other
);
52 virtual void move(const Move
& move
);
54 virtual TaguaObject
* flags();
55 virtual const TaguaObject
* flags() const;
57 virtual int rank(int n
, const IColor
* turn
) const;
59 virtual const IPoolCollection
* pools() const;
60 virtual IPoolCollection
* pools();
62 virtual const IBehaviour
* behaviour() const;
64 virtual void setDelegator(IState
* delegator
);
66 virtual Component
* clone(const IBehaviour
* behaviour
,
67 const Point
& size
) const;
72 #endif // SHOGI__STATE_H