Initial porting to the new component API.
[tagua/yd.git] / src / entities / entity.h
blob7cca67641f4c2be0699ba84f154096d9c3bf86dc
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 ENTITY_H
12 #define ENTITY_H
14 #include <core/state_fwd.h>
15 #include "game_fwd.h"
16 #include "usermove.h"
18 class Entity {
19 protected:
20 bool m_enabled : 1;
21 bool m_highlight : 1;
23 GamePtr m_game;
24 public:
25 explicit Entity(const GamePtr& game);
26 /**
27 * Detach from dependent resource disposing it.
29 virtual ~Entity();
31 bool highlight() const { return m_highlight; }
32 void setHighlight(bool highlight) { m_highlight = highlight; }
34 void setEnabled(bool enabled) { m_enabled = enabled; }
36 virtual bool canDetach() const = 0;
37 /**
38 * Detach from dependent resource without disposing it.
40 virtual void detach() { }
42 GamePtr game() const;
43 StatePtr position() const;
46 #endif // ENTITY_H