AirsoftTimer software based on mbed

Dependencies:   mbed TextLCD keypad

objectives/WaitForKeyObjective.cpp

Committer:
sillevl
Date:
2015-05-24
Revision:
25:a26b2ec5ab72
Parent:
24:f0989eca7469
Child:
27:f29805113454

File content as of revision 25:a26b2ec5ab72:


#include "WaitForKeyObjective.h"
#include "../games/Game.h"

WaitForKeyObjective::WaitForKeyObjective(Game* game) : Objective(game){
    //keyboard->attach(this, &WaitForKeyObjective::buttonEvent);
}

void WaitForKeyObjective::run(){  
    lcd->cls();
    lcd->printf("press any key");
    lcd->locate(0,1);
    lcd->printf("to continue...");
    
    //wait until completed
    while(getStatus() != COMPLETED){}
}

void WaitForKeyObjective::buttonEvent(char c){
    // complete objective if a button is pressed
    complete();
}