Add a move-generator API.
[tagua/yd.git] / src / core / delegators / state.h
bloba2155ae2448b47189593be9c6b5967bb8875c564
1 /*
2 Copyright (c) 2007 Paolo Capriotti <p.capriotti@gmail.com>
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or
7 (at your option) any later version.
8 */
10 #ifndef DELEGATORS__STATE_H
11 #define DELEGATORS__STATE_H
13 #include "../state.h"
15 /**
16 * @brief Namespace holding delegators to core Tagua components.
18 namespace Delegators {
20 class State : virtual public IState {
21 protected:
22 IState* m_state;
23 public:
24 State(IState* state) : m_state(state) { m_state->setDelegator(this); }
25 virtual ~State() { delete m_state; }
27 virtual IState* clone() const { return new State(m_state->clone()); }
28 virtual void setup() { m_state->setup(); }
29 virtual const Board* board() const { return m_state->board(); }
30 virtual Board* board() { return m_state->board(); }
31 virtual const IColor* turn() const { return m_state->turn(); }
32 virtual void setTurn(const IColor* turn) { m_state->setTurn(turn); }
33 virtual bool equals(IState* other) const { return m_state->equals(other); }
34 virtual void assign(const IState* other) { m_state->assign(other); }
35 virtual void move(const Move& move) { m_state->move(move); }
36 virtual TaguaObject* flags() { return m_state->flags(); }
37 virtual const TaguaObject* flags() const { return m_state->flags(); }
38 virtual int rank(int n, const IColor* turn) const { return m_state->rank(n, turn); }
39 virtual const IPoolCollection* pools() const { return m_state->pools(); }
40 virtual IPoolCollection* pools() { return m_state->pools(); }
41 virtual const IBehaviour* behaviour() const { return m_state->behaviour(); }
42 virtual void setDelegator(IState* state) { m_state->setDelegator(state); }
47 #endif // DELEGATORS__STATE_H