mirror of
https://github.com/QuantumLeaps/qpcpp.git
synced 2025-01-14 05:42:57 +08:00
16 lines
542 B
C++
16 lines
542 B
C++
class Bomb : public QFsm { // derived from QFsm
|
|
uint8_t m_timeout; // number of seconds till explosion
|
|
uint8_t m_defuse; // the secret defuse code
|
|
uint8_t m_code; // the current defuse code entry
|
|
|
|
public:
|
|
Bomb() : QFsm(Q_STATE_CAST(&QBomb::initial)) {
|
|
}
|
|
|
|
protected:
|
|
static QState initial(Bomb * const me, QEvt const *e);
|
|
static QState setting(Bomb * const me, QEvt const *e);
|
|
static QState timing(Bomb * const me, QEvt const *e);
|
|
static QState blast(Bomb * const me, QEvt const *e);
|
|
};
|