void SlotMachine::play(Player &player) { int menuSelect = 0; bool continueLoop = true; int bet = 0; static int run = 0; while (continueLoop) { if (run++ == 0) { buildMachine(player); // just for show to build display } if (processInput(bet)) { spin(bet, player); } else { continueLoop = false; run = 0; } } }
void MouseMachine::setOptions(Options options) { m_options = options; machine->stop(); buildMachine(); machine->start(); }
MouseMachine::MouseMachine(QWidget* parent, MouseMachine::Options options) : QObject(parent) , theParent(parent) , m_options(options) , machine(0) , trPressed2Idle(0) , trPressed2Man(0) , trManScrolling(0) , trIdle2Pressed(0) , trMan2Auto(0) , trMan2Idle(0) , trAuto2Idle(0) , trAuto2Man(0) , trDoubleclick(0) { #ifdef Q_OS_SYMBIAN iTouchFeedback = MTouchFeedback::Instance(); #endif speedTimer.setInterval(SPEED_INTERVAL); connect(&speedTimer, SIGNAL(timeout()), SLOT(slotCalculateSpeed())); dblclickTimer.setInterval(DBLCLICK_INTERVAL); dblclickTimer.setSingleShot(true); connect(&dblclickTimer, SIGNAL(timeout()), SLOT(slotSingleTap())); scrollTimeline.setCurveShape(QTimeLine::EaseOutCurve); scrollTimeline.setEasingCurve(QEasingCurve::OutQuad); connect(&scrollTimeline, SIGNAL(valueChanged(qreal)), SLOT(slotAutoscroll(qreal))); connect(&scrollTimeline, SIGNAL(finished()), SLOT(slotAutoscrollFinished())); tapHoldTimer.setInterval(TAPHOLD_TIMEOUT); tapHoldTimer.setSingleShot(true); theTarget = theParent; QAbstractScrollArea *scrollArea = qobject_cast<QAbstractScrollArea*>(theParent); if (scrollArea) { scrollArea->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); scrollArea->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); theTarget = scrollArea->viewport(); theTarget->installEventFilter(this); } theParent->installEventFilter(this); buildMachine(); machine->start(); }
int main (int argc, char *argv[]) { printf("Type a number to decrease health by that much. EG '2' dreaces health by 2. Press any other key to do nothing.\n"); doFeedbackLoop(buildMachine()); return 0; }