Update l10n files, translate into french a bit more.
[tagua/yd.git] / src / entities / gameentity.h
blob293ee9ba539a681c5ad88dfc8141a28d2469865e
1 /*
2 Copyright (c) 2006 Paolo Capriotti <p.capriotti@gmail.com>
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"
17 #include "fwd.h"
19 class Board;
21 class GameEntity : public UserEntity {
22 VariantPtr m_variant;
23 Board* m_chessboard;
24 AgentGroupDispatcher m_dispatcher;
25 boost::shared_ptr<class Premove> m_premoveQueue;
27 AbstractPosition::Ptr doMove(AbstractMove::Ptr move) const;
28 public:
29 GameEntity(const VariantPtr& variant, const boost::shared_ptr<Game>& game,
30 Board* chessboard, AgentGroup* group);
32 /**
33 * Return a PGN for the game.
35 virtual QString save() const;
37 /**
38 * Load the content of a PGN inside the game.
40 virtual void loadPGN(const PGN& pgn);
42 virtual void executeMove(AbstractMove::Ptr move);
43 virtual void addPremove(const NormalUserMove& m);
44 virtual void addPremove(const DropUserMove& m);
45 virtual void cancelPremove();
47 virtual void notifyClockUpdate(int, int) { }
48 virtual void notifyMove(const Index&);
49 virtual void notifyBack();
50 virtual void notifyForward();
51 virtual void notifyGotoFirst();
52 virtual void notifyGotoLast();
54 virtual NormalUserMove createMove(const Point& from, const Point& to) const;
55 virtual AbstractMove::Ptr testMove(const NormalUserMove&) const;
56 virtual AbstractMove::Ptr testMove(const DropUserMove&) const;
57 virtual AbstractPiece::Ptr moveHint(AbstractMove::Ptr move) const;
58 virtual bool testPremove(const NormalUserMove&) const;
59 virtual bool testPremove(const DropUserMove&) const;
60 virtual InteractionType validTurn(const Point&) const;
61 virtual InteractionType validTurn(int) const;
62 virtual bool movable(const Point&) const;
63 virtual bool oneClickMoves() const;
65 virtual bool gotoFirst();
66 virtual bool gotoLast();
67 virtual bool goTo(const Index& index);
68 virtual bool forward();
69 virtual bool back();
70 virtual bool undo();
71 virtual bool redo();
72 virtual bool truncate();
73 virtual bool promoteVariation();
75 virtual bool canDetach() const;
78 #endif // GAMEENTITY_H