1 #ifndef DELEGATORS__DEFAULT_STATE_H
2 #define DELEGATORS__DEFAULT_STATE_H
5 #include "../defaultstate.h"
11 namespace Delegators
{
13 class DefaultState
: public State
, public ::DefaultState
{
15 ::DefaultState
* m_state
;
17 DefaultState(IState
* state
)
19 ::DefaultState
* dstate
= dynamic_cast< ::DefaultState
*>(state
);
21 kError() << "Delegators::DefaultState needs a ::DefaultState, cannot use a"
22 << typeid(state
).name();
27 m_state
->setDelegator(this);
29 virtual ~DefaultState() { delete m_state
; }
31 virtual std::vector
<const Point
*> theoreticalMoves(const Piece
& piece
,
32 const Point
& src
) const
33 { return m_state
->theoreticalMoves(piece
, src
); }
36 } // namespace Delegators
38 #endif // DELEGATORS__DEFAULT_STATE_H