#include "exit.h" Exit::Exit(int id, int x, int y, QCanvasSprite *sprite) : Sprite(id, x, y, sprite) { m_activated = false; m_highlighted = false; } void Exit::proceed() { if ((m_activated) && (m_highlighted)) { if((m_sprite) && (m_sprite->frameCount() > 2)) { if (m_sprite->frame() == 1) m_sprite->setFrame(2); else m_sprite->setFrame(1); } } } void Exit::setHighlighted(bool value) { m_highlighted = value; } bool Exit::isHighlighted() { return m_highlighted; } void Exit::activate(bool value) { m_activated = value; if((m_sprite) && (m_sprite->frameCount() > 2)) { if(m_activated) m_sprite->setFrame(1); else m_sprite->setFrame(0); } } bool Exit::isActive() { return m_activated; }