1 #ifndef DELEGATORS__DEFAULT_STATE_H
2 #define DELEGATORS__DEFAULT_STATE_H
4 #include "../defaultstate.h"
10 namespace Delegators
{
12 class DefaultState
: public State
, public ::DefaultState
{
14 ::DefaultState
* m_state
;
16 DefaultState(IState
* state
)
18 ::DefaultState
* dstate
= dynamic_cast< ::DefaultState
*>(state
);
20 kError() << "Delegators::DefaultState needs a ::DefaultState, cannot use a"
21 << typeid(state
).name();
26 m_state
->setDelegator(this);
28 virtual ~DefaultState() { delete m_state
; }
30 virtual std::vector
<const Point
*> theoreticalMoves(const Piece
& piece
,
31 const Point
& src
) const
32 { return m_state
->theoreticalMoves(piece
, src
); }
35 } // namespace Delegators
37 #endif // DELEGATORS__DEFAULT_STATE_H