added game.h player.h and uart.h, implemented game objects

This commit is contained in:
id101010
2016-01-12 19:30:20 +01:00
parent 277a7b86d1
commit 6a136923d2
4 changed files with 87 additions and 0 deletions

26
src/game.h Normal file
View File

@@ -0,0 +1,26 @@
#ifndef PLAYER_H
#define PLAYER_H
#include<stdint.h>
#include<stdlib.h>
#include"player.h"
#define PLAYER_COUNT 2
typedef struct game_s{
uint16_t time; // seconds since game start
uint8_t winner_id;
uint8_t host_id;
player_t player[PLAYER_COUNT];
enum{
running,
ended
} state;
} game_t;
void game_init(game_t* game);
void game_step(game_t* game, uint16_t time_delta);
#endif /* PLAYER_H */