Initial porting to the new component API.
[tagua/yd.git] / src / entities / examinationentity.h
blob2313c81108634b4d6b4899f1e00e2fdb656dddb9
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 EXAMINATIONENTITY_H
12 #define EXAMINATIONENTITY_H
14 #include "agent.h"
15 #include "agentgroup.h"
16 #include "userentity.h"
17 #include "icsapi_fwd.h"
18 #include "icslistener.h"
20 class ICSConnection;
21 class Variant;
23 class ExaminationEntity : public UserEntity
24 , public ICSListener {
25 Variant* m_variant;
26 ICSAPIPtr m_icsapi;
28 int m_game_number;
29 boost::shared_ptr<ICSConnection> m_connection;
30 AgentGroupDispatcher m_dispatcher;
31 public:
32 ExaminationEntity(Variant*, const boost::shared_ptr<Game>&,
33 int, const boost::shared_ptr<ICSConnection>&, AgentGroup*);
35 virtual QString save() const;
36 virtual void loadPGN(const PGN&);
38 virtual bool testMove(Move&) const;
39 virtual bool testPremove(const Move&) const;
40 virtual void executeMove(const Move&);
41 virtual void addPremove(const Move&);
42 virtual void cancelPremove();
43 virtual InteractionType validTurn(const Point&) const;
44 virtual InteractionType validTurn(const IColor*) const;
45 virtual bool movable(const Point&) const;
46 virtual bool jump(const Index&);
47 virtual bool gotoFirst();
48 virtual bool gotoLast();
49 virtual bool goTo(const Index&);
50 virtual bool forward();
51 virtual bool back();
52 virtual bool undo();
53 virtual bool redo();
54 virtual bool truncate();
55 virtual bool promoteVariation();
57 virtual void notifyStyle12(const PositionInfo&, bool is_starting);
58 virtual void notifyPool(const PoolInfo&);
59 virtual void notifyMoveList(int, const StatePtr&, const PGN&);
61 virtual void notifyClockUpdate(int, int) { }
62 virtual void notifyMove(const Index&);
63 virtual void notifyBack();
64 virtual void notifyForward();
65 virtual void notifyGotoFirst();
66 virtual void notifyGotoLast();
68 virtual bool attach();
71 #endif // EXAMINATIONENTITY_H