refresh bdc45694d411cad215e68161e75bb9f1a8a39e47
[tagua/yd.git] / src / variants / shogi / state.h
blob8a46912009131441bf1a4a238bd35d5559c0661e
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 SHOGI__STATE_H
12 #define SHOGI__STATE_H
14 #include <core/board.h>
15 #include <core/component.h>
16 #include <core/state.h>
17 #include <core/piece.h>
18 #include <core/taguaobject.h>
20 namespace Shogi {
22 class State : public Component, public IState {
23 Q_OBJECT
24 Board m_board;
25 TaguaObject m_flags;
26 const IColor* m_turn;
27 const IBehaviour* m_behaviour;
28 IState* m_delegator;
29 IPoolCollection* m_pools;
30 protected:
31 State(const State&);
32 public:
33 State(const IBehaviour* behaviour,
34 const Point& size);
35 virtual ~State();
36 public:
37 virtual IState* clone() const;
39 virtual void setup();
41 virtual const Board* board() const;
42 virtual Board* board();
44 virtual const IColor* turn() const;
46 virtual void setTurn(const IColor* turn);
48 virtual bool equals(IState* other) const;
50 virtual void assign(const IState* other);
52 virtual void move(const Move& move);
54 virtual TaguaObject* flags();
55 virtual const TaguaObject* flags() const;
57 virtual int rank(int n, const IColor* turn) const;
59 virtual const IPoolCollection* pools() const;
60 virtual IPoolCollection* pools();
62 virtual const IBehaviour* behaviour() const;
64 virtual void setDelegator(IState* delegator);
65 public Q_SLOTS:
66 virtual Component* clone(const IBehaviour* behaviour,
67 const Point& size) const;
70 } // namespace Shogi
72 #endif // SHOGI__STATE_H