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.
14 #include "userentity.h"
16 #include "agentgroup.h"
21 class GameEntity
: public UserEntity
{
24 AgentGroupDispatcher m_dispatcher
;
25 boost::shared_ptr
<class Premove
> m_premoveQueue
;
27 AbstractPosition::Ptr
doMove(AbstractMove::Ptr move
) const;
29 GameEntity(const VariantPtr
& variant
, const boost::shared_ptr
<Game
>& game
,
30 Board
* chessboard
, AgentGroup
* group
);
33 * Return a PGN for the game.
35 virtual QString
save() const;
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 AbstractMove::Ptr
testMove(const NormalUserMove
&) const;
55 virtual AbstractMove::Ptr
testMove(const DropUserMove
&) const;
56 virtual AbstractPiece::Ptr
moveHint(AbstractMove::Ptr move
) const;
57 virtual bool testPremove(const NormalUserMove
&) const;
58 virtual bool testPremove(const DropUserMove
&) const;
59 virtual InteractionType
validTurn(const Point
&) const;
60 virtual InteractionType
validTurn(int) const;
61 virtual bool movable(const Point
&) const;
62 virtual bool oneClickMoves() const;
64 virtual bool gotoFirst();
65 virtual bool gotoLast();
66 virtual bool goTo(const Index
& index
);
67 virtual bool forward();
71 virtual bool truncate();
72 virtual bool promoteVariation();
74 virtual bool canDetach() const;
77 #endif // GAMEENTITY_H