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.
14 #include <core/state_fwd.h>
16 #include "agentgroup.h"
17 #include "userentity.h"
24 class GameEntity
: public UserEntity
{
27 IValidator
* m_validator
;
28 ChessBoard
* m_chessboard
;
29 AgentGroupDispatcher m_dispatcher
;
32 StatePtr
doMove(const Move
& move
) const;
34 GameEntity(Variant
* variant
, const boost::shared_ptr
<Game
>& game
,
35 ChessBoard
* chessboard
, AgentGroup
* group
);
38 * Return a PGN for the game.
40 virtual QString
save() const;
43 * Load the content of a PGN inside the game.
45 virtual void loadPGN(const PGN
& pgn
);
47 virtual void executeMove(const Move
& move
);
48 virtual void addPremove(const Move
& m
);
49 virtual void cancelPremove();
51 virtual void notifyClockUpdate(int, int) { }
52 virtual void notifyMove(const Index
&);
53 virtual void notifyBack();
54 virtual void notifyForward();
55 virtual void notifyGotoFirst();
56 virtual void notifyGotoLast();
58 virtual bool testMove(Move
&) const;
59 virtual bool testPremove(const Move
&) const;
60 virtual Piece
moveHint(const Move
& move
) const;
62 virtual InteractionType
validTurn(const Point
&) const;
63 virtual InteractionType
validTurn(const IColor
*) const;
64 virtual bool movable(const Point
&) const;
65 virtual bool oneClickMoves() const;
67 virtual bool gotoFirst();
68 virtual bool gotoLast();
69 virtual bool goTo(const Index
& index
);
70 virtual bool forward();
74 virtual bool truncate();
75 virtual bool promoteVariation();
77 virtual bool canDetach() const;
80 #endif // GAMEENTITY_H