/** -*- C++ -*- @file adept/actor.h @author Peter Rockai */ #include #include #include #ifndef EPT_ACTOR_H #define EPT_ACTOR_H namespace adept { using namespace aptFront; class EntityActor : public QObject { Q_OBJECT public: EntityActor( actor::Bound< cache::entity::Entity > a ) : m_actor( a ), m_dead( false ) {} actor::Bound< cache::entity::Entity > actor() const { return m_actor; } public slots: void act() { m_actor(); } void destructiveAct() { // in case we don't get deleted soon enough if ( m_dead ) return; m_dead = true; act(); deleteLater(); } protected: actor::Bound< cache::entity::Entity > m_actor; bool m_dead; }; } #endif