Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed
Cricket/Cricket.h
- Committer:
- shahidsajid
- Date:
- 2019-05-01
- Revision:
- 26:6427f09cf8d3
- Parent:
- 24:23fd6b451db7
- Child:
- 28:d0b0a64a832d
File content as of revision 26:6427f09cf8d3:
#ifndef CRICKET_H #define CRICKET_H #include "mbed.h" #include "N5110.h" #include "Gamepad.h" #include "Ball.h" #include "Scoreboard.h" #include "UX.h" /** Ball Class @author Shahid Zubin Sajid @brief Controls the ball in the Cricket team @date May 2019 */ class Cricket { public: Cricket(); ~Cricket(); void init(); void draw(N5110 &lcd); //Setters void set_field(N5110 &lcd); void set_init_positions(int x,int y, Direction direction,int no); void set_ball_direction(Direction dir); // void draw_field(N5110 &lcd); void update_game(int checkHit,int loft_check, Direction dir,Gamepad &pad,N5110 &lcd); void play_game(N5110 &lcd,Gamepad &pad); void update_scoreboard(int checkUpdate, int runs,Gamepad &pad); void batsman_out(int option,Gamepad &pad, N5110 &lcd); void check_victory(N5110 &lcd); void game(N5110 &lcd,Gamepad &pad); void intro(N5110 &lcd); bool game_status(N5110 &lcd); void info_screen(N5110 &lcd, int target); void init_positions(); void round_reset(); void game_reset(); int check_fielder(Direction dir); bool check_ball_count(N5110 &lcd); private: Ball ball; Bat bat; Scoreboard scoreboard; UX ux; struct fielder_positions{ Direction dir; int x; int y; int no; }; fielder_positions positions[7]; struct Fielder{ Direction dir; int x; int y; int position; }; Fielder field[5]; Direction _ball_direction; int _check_bowled; int _init_field_counter; int _fielders_count; int _new_round; int field_numbers[10]; int _position_no; int ballHit; int _ball_limit; int _new_game; int _check_update; int _check_hit; int _set_hit; int _set_loft; int _direction_set; int _loft_check; //int d; }; #endif