push fbe27195cb72bcf9f72636c6745f4e17f1858734
[tagua/yd.git] / src / core / delegators / defaultstate.h
blob5881ade10b89615ba40b0c455c1ad98497e25edb
1 #ifndef DELEGATORS__DEFAULT_STATE_H
2 #define DELEGATORS__DEFAULT_STATE_H
4 #include "../defaultstate.h"
6 namespace Delegators {
8 class DefaultState : public State, public ::DefaultState {
9 public:
10 #if 0
11 DefaultState(IState* state)
12 : State(state) {
13 ::DefaultState* dstate = dynamic_cast< ::DefaultState*>(state);
14 if (dstate == NULL) {
15 kError() << "Delegators::DefaultState needs a ::DefaultState, cannot use a"
16 << typeid(state).name();
17 abort();
20 m_state = dstate;
21 m_state->setDelegator(this);
23 virtual ~DefaultState() { delete m_state; }
24 #endif
26 virtual std::vector<const Point*> theoreticalMoves(const Piece& piece,
27 const Point& src) const
28 { return m_state->theoreticalMoves(piece, src); }
31 } // namespace Delegators
33 #endif // DELEGATORS__DEFAULT_STATE_H