AirsoftTimer software based on mbed

Dependencies:   mbed TextLCD keypad

Committer:
sillevl
Date:
Thu Feb 09 12:28:56 2017 +0000
Revision:
27:f29805113454
Parent:
24:f0989eca7469
ARCHIVE WIP, not working (crashes, cause unknown)

Who changed what in which revision?

UserRevisionLine numberNew contents of line
sillevl 13:ece97a1108cc 1
sillevl 13:ece97a1108cc 2 #include "Objective.h"
sillevl 24:f0989eca7469 3 #include "../games/Game.h"
sillevl 13:ece97a1108cc 4
sillevl 23:eb5a5da6e83f 5
sillevl 14:e0bfee0a5e66 6 Objective::Objective(Game* game){
sillevl 14:e0bfee0a5e66 7 this->game = game;
sillevl 14:e0bfee0a5e66 8 Board* board = game->getBoard();
sillevl 14:e0bfee0a5e66 9 lcd = board->lcd;
sillevl 14:e0bfee0a5e66 10 leds = board->leds;
sillevl 14:e0bfee0a5e66 11 key = board->key;
sillevl 14:e0bfee0a5e66 12 button = board->button;
sillevl 14:e0bfee0a5e66 13 keyboard = board->keyboard;
sillevl 14:e0bfee0a5e66 14 buzzer = board->buzzer;
sillevl 16:e8e96bf22df1 15
sillevl 13:ece97a1108cc 16 status = WAITING;
sillevl 13:ece97a1108cc 17 }
sillevl 13:ece97a1108cc 18
sillevl 13:ece97a1108cc 19 Objective::Status Objective::getStatus(){
sillevl 13:ece97a1108cc 20 return status;
sillevl 13:ece97a1108cc 21 }
sillevl 13:ece97a1108cc 22
sillevl 13:ece97a1108cc 23 void Objective::start(){
sillevl 13:ece97a1108cc 24 while(status != COMPLETED){
sillevl 13:ece97a1108cc 25 run();
sillevl 27:f29805113454 26 leds->on(Leds::LEFT);
sillevl 13:ece97a1108cc 27 }
sillevl 13:ece97a1108cc 28 }
sillevl 13:ece97a1108cc 29
sillevl 13:ece97a1108cc 30 void Objective::complete(){
sillevl 13:ece97a1108cc 31 status = COMPLETED;
sillevl 27:f29805113454 32 leds->off(Leds::RIGHT);
sillevl 13:ece97a1108cc 33 }
sillevl 13:ece97a1108cc 34