AirsoftTimer software based on mbed

Dependencies:   mbed TextLCD keypad

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Game.cpp Source File

Game.cpp

00001 #include "Game.h"
00002 
00003 Game::Game(Board* board){
00004     this->board = board;
00005     lcd = board->lcd;
00006     leds = board->leds;
00007     key = board->key;
00008     button = board->button;
00009     keyboard = board->keyboard;
00010     buzzer = board->buzzer;
00011     
00012     board->leds->off(Leds::ALL);   
00013 }
00014 
00015 Game::~Game(){
00016     
00017 }
00018 
00019 Board* Game::getBoard(){
00020     return board;
00021 }
00022 
00023 void Game::run(){
00024     for(int i = 0; i != objectives.size(); ++i){
00025         objectives[i]->start();
00026     }
00027 }
00028 
00029 void Game::init(){
00030     board->lcd->cls();
00031     board->lcd->printf("Starting game");
00032     board->lcd->locate(1,0);
00033     board->lcd->printf("DummyGame");
00034     wait(3);
00035 }
00036 
00037 void Game::end(){
00038     board->lcd->cls();
00039     board->lcd->printf("Ending game");
00040     board->lcd->locate(1,0);
00041     board->lcd->printf("DummyGame");
00042     wait(5);
00043 }
00044