new 4475edb243ed4627f4c5f2c470ca40b3def034d4
[tagua/yd.git] / src / entities / engineentity.h
blob0acbad6398d55ccaf0ef50dd8e6d438c5f1dbffe
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 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"
20 class Components;
21 class Engine;
22 class IColor;
23 class Variant;
25 class EngineEntity : public Entity
26 , public Agent
27 , public EngineNotifier {
28 Components* m_components;
29 const IColor* m_side;
30 Index m_last_index;
31 bool m_playing;
32 boost::shared_ptr<Engine> m_engine;
33 AgentGroupDispatcher m_dispatcher;
35 void checkPlaying();
36 public:
37 boost::shared_ptr<Engine> engine() { return m_engine; }
39 EngineEntity(Components* components, const boost::shared_ptr<Game>&, const IColor* side,
40 const boost::shared_ptr<Engine>& engine, AgentGroup* group);
41 void setup();
43 virtual void notifyEngineMove(const QString&);
45 virtual bool canDetach() const { return true; }
47 virtual void notifyClockUpdate(int, int) { }
48 virtual void notifyMove(const Index& index);
49 virtual void notifyBack() { }
50 virtual void notifyForward() { }
51 virtual void notifyGotoFirst() { }
52 virtual void notifyGotoLast() { }
55 #endif // ENGINEENTITY_H