Initial porting to the new component API.
[tagua/yd.git] / src / entities / engineentity.h
blob554a05aba02efca5714978496ef9891cad5b74be
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 Engine;
21 class IColor;
22 class Variant;
24 class EngineEntity : public Entity
25 , public Agent
26 , public EngineNotifier {
27 Variant* m_variant;
28 const IColor* m_side;
29 Index m_last_index;
30 bool m_playing;
31 boost::shared_ptr<Engine> m_engine;
32 AgentGroupDispatcher m_dispatcher;
34 void checkPlaying();
35 public:
36 boost::shared_ptr<Engine> engine() { return m_engine; }
38 EngineEntity(Variant* variant, const boost::shared_ptr<Game>&, const IColor* side,
39 const boost::shared_ptr<Engine>& engine, AgentGroup* group);
40 void setup();
42 virtual void notifyEngineMove(const QString&);
44 virtual bool canDetach() const { return true; }
46 virtual void notifyClockUpdate(int, int) { }
47 virtual void notifyMove(const Index& index);
48 virtual void notifyBack() { }
49 virtual void notifyForward() { }
50 virtual void notifyGotoFirst() { }
51 virtual void notifyGotoLast() { }
54 #endif // ENGINEENTITY_H