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/turnpolicy.h>
17 #include "agentgroup.h"
18 #include "icsapi_fwd.h"
19 #include "icslistener.h"
22 class IMoveSerializer
;
28 class ICSEntity
: public Entity
30 , public ICSListener
{
33 IValidator
* m_validator
;
35 IMoveSerializer
* m_serializer
;
36 IMoveSerializer
* m_san_serializer
;
38 boost::shared_ptr
<ICSConnection
> m_connection
;
42 AgentGroupDispatcher m_dispatcher
;
44 void updateGame(const Index
& index
, Move
& icsMove
, const StatePtr
& icsPos
);
55 UpdateType
getUpdate(const Index
& index
);
57 ICSEntity(Variant
*, const boost::shared_ptr
<Game
>&,
59 const boost::shared_ptr
<ICSConnection
>&, AgentGroup
*);
61 virtual void executeMove(const Move
&);
62 virtual void notifyStyle12(const PositionInfo
&, bool is_starting
);
63 virtual void notifyPool(const PoolInfo
&);
64 virtual void notifyMoveList(int, const StatePtr
&, const PGN
&);
66 virtual StatePtr
position() const;
68 virtual void notifyClockUpdate(int, int) { }
69 virtual void notifyMove(const Index
&);
70 virtual void notifyBack() { }
71 virtual void notifyForward() { }
72 virtual void notifyGotoFirst() { }
73 virtual void notifyGotoLast() { }
77 virtual bool canDetach() const;
78 virtual bool attach();
81 bool canEdit(const Index
& index
) const;
82 void setupTurnTest(TurnTest
& test
) const;
85 class ObservingEntity
: public ICSEntity
{
89 ObservingEntity(Variant
*, const boost::shared_ptr
<Game
>&,
90 int gameNumber
, const boost::shared_ptr
<ICSConnection
>&, AgentGroup
*);
93 virtual void detach();