Added logic in EngineEntity to ignore redundant notifications.
[tagua/yd.git] / src / entities / engineentity.h
blob89cf74577a7eb13afc9c628d4fb86b6b740ed682
1 /*
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.
9 */
11 #ifndef ENGINEENTITY_H
12 #define ENGINEENTITY_H
14 #include "agent.h"
15 #include "agentgroup.h"
16 #include "enginenotifier.h"
17 #include "entity.h"
18 #include "index.h"
19 #include "tagua.h"
21 class Engine;
23 class EngineEntity : public Entity
24 , public Agent
25 , public EngineNotifier {
26 VariantInfo* m_variant;
27 int m_side;
28 Index m_last_index;
29 boost::shared_ptr<Engine> m_engine;
30 AgentGroupDispatcher m_dispatcher;
32 void executeMove(AbstractMove::Ptr move);
33 public:
34 boost::shared_ptr<Engine> engine() { return m_engine; }
36 EngineEntity(VariantInfo* variant, const boost::shared_ptr<Game>&, int side,
37 const boost::shared_ptr<Engine>& engine, AgentGroup* group);
39 virtual void notifyEngineMove(const QString&);
41 virtual bool canDetach() const { return true; }
43 virtual void notifyClockUpdate(int, int) { }
44 virtual void notifyMove(const Index& index);
45 virtual void notifyBack() { }
46 virtual void notifyForward() { }
47 virtual void notifyGotoFirst() { }
48 virtual void notifyGotoLast() { }
51 #endif // ENGINEENTITY_H