Agent::notifyMove now takes an Index instead of a move-position pair.
[tagua/yd.git] / src / entities / gameentity.h
blobddf0d697ef6394ded4b0db6e2e18d1bd93c268f6
1 /*
2 Copyright (c) 2006 Paolo Capriotti <p.capriotti@sns.it>
3 (c) 2006 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 GAMEENTITY_H
12 #define GAMEENTITY_H
14 #include "userentity.h"
15 #include "agent.h"
16 #include "agentgroup.h"
18 class Board;
20 class GameEntity : public UserEntity {
21 VariantInfo* m_variant;
22 Board* m_chessboard;
23 AgentGroupDispatcher m_dispatcher;
24 boost::shared_ptr<class Premove> m_premoveQueue;
26 AbstractPosition::Ptr doMove(AbstractMove::Ptr move) const;
27 public:
28 GameEntity(VariantInfo* variant, const boost::shared_ptr<Game>& game,
29 Board* chessboard, AgentGroup* group);
31 /**
32 * Return a PGN for the game.
34 virtual QString save() const;
36 /**
37 * Load the content of a PGN inside the game.
39 virtual void loadPGN(const PGN& pgn);
41 virtual void executeMove(AbstractMove::Ptr move);
42 virtual void addPremove(const NormalUserMove& m);
43 virtual void addPremove(const DropUserMove& m);
44 virtual void cancelPremove();
46 virtual void notifyClockUpdate(int, int) { }
47 virtual void notifyMove(const Index&);
48 virtual void notifyBack();
49 virtual void notifyForward();
50 virtual void notifyGotoFirst();
51 virtual void notifyGotoLast();
53 virtual AbstractMove::Ptr testMove(const NormalUserMove&) const;
54 virtual AbstractMove::Ptr testMove(const DropUserMove&) const;
55 virtual AbstractPiece::Ptr moveHint(AbstractMove::Ptr move) const;
56 virtual bool testPremove(const NormalUserMove&) const;
57 virtual bool testPremove(const DropUserMove&) const;
58 virtual InteractionType validTurn(const Point&) const;
59 virtual InteractionType validTurn(int) const;
60 virtual bool movable(const Point&) const;
61 virtual bool oneClickMoves() const;
63 virtual bool gotoFirst();
64 virtual bool gotoLast();
65 virtual bool goTo(const Index& index);
66 virtual bool forward();
67 virtual bool back();
68 virtual bool undo();
69 virtual bool redo();
70 virtual bool truncate();
71 virtual bool promoteVariation();
73 virtual bool canDetach() const;
76 #endif // GAMEENTITY_H