Tentative Randomless-Entropy variant.
[tagua/yd.git] / src / variants / randomless-entropy / state.h
blobbe43c616120d0daeee1aa214b3fd6c92c9c3f78b
1 /*
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.
9 */
11 #ifndef RANDOMLESSENTROPY__STATE_H
12 #define RANDOMLESSENTROPY__STATE_H
14 #include <core/board.h>
15 #include <core/defaultstate.h>
16 #include <core/piece.h>
17 #include <core/taguaobject.h>
19 /**
20 * @brief Namespace holding Randomless-Entropy components.
22 * @details Randomless-Entropy is a variant of Entropy where Chaos
23 * does not randomly draws the next stone to place, but can choose
24 * from all stones in the pool.
26 namespace RandomlessEntropy {
28 class State : public DefaultState {
29 Q_OBJECT
30 Board m_board;
31 const IColor* m_turn;
32 const IBehaviour* m_behaviour;
33 IState* m_delegator;
34 IPoolCollection* m_pools;
35 protected:
36 State(const State&);
37 public:
38 State(const IBehaviour* behaviour,
39 const Point& size);
40 virtual ~State();
41 public:
42 virtual IState* clone() const;
44 virtual void setup();
46 virtual const Board* board() const;
47 virtual Board* board();
49 virtual const IColor* turn() const;
51 virtual void setTurn(const IColor* turn);
53 virtual bool equals(IState* other) const;
55 virtual void assign(const IState* other);
57 virtual void move(const Move& move);
59 virtual TaguaObject* flags() { return NULL; };
60 virtual const TaguaObject* flags() const { return NULL; };
62 virtual int rank(int n, const IColor* turn) const;
64 virtual const IPoolCollection* pools() const;
65 virtual IPoolCollection* pools();
67 virtual const IBehaviour* behaviour() const;
69 virtual void setDelegator(IState* delegator);
70 public Q_SLOTS:
71 virtual Component* clone(const IBehaviour* behaviour,
72 const Point& size) const;
75 } // namespace RandomlessEntropy
77 #endif // RANDOMLESSENTROPY__STATE_H