-
Notifications
You must be signed in to change notification settings - Fork 0
/
soccer.h
82 lines (69 loc) · 1.64 KB
/
soccer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#ifndef SOCCER_H
#define SOCCER_H
#define MAX_X 80
#define MAX_Y 23
#define TIME_LIMIT 20
#define TIME_OUT 3000
#define KICK_DIST 10
#ifndef PI
#define PI 3.1415927
#endif
#define SQR2 1.4142136
#define EMPTY 0
#define GOAL 1
#define BALL 2
#define BOUNDARY 3
#define WEST_PLAYER 6
#define EAST_PLAYER 7
#define BIGGEST_SIT 7
#define NW 0
#define N 1
#define NE 2
#define W 3
#define PLAYER 4
#define E 5
#define SW 6
#define S 7
#define SE 8
#define KICK 9
#define DO_NOTHING 10
#define BIGGEST_ACTION 10
void EASTinitialize_game(void);
void EASTgame_over(void);
void EASTinitialize_point(void);
void EASTwon_point(void);
void EASTlost_point(void);
int EASTplayer1(int *, int, int, int);
int EASTplayer2(int *, int, int, int);
int EASTplayer3(int *, int, int, int);
int EASTplayer4(int *, int, int, int);
void WESTinitialize_game(void);
void WESTgame_over(void);
void WESTinitialize_point(void);
void WESTwon_point(void);
void WESTlost_point(void);
int WESTplayer1(int *, int, int, int);
int WESTplayer2(int *, int, int, int);
int WESTplayer3(int *, int, int, int);
int WESTplayer4(int *, int, int, int);
char *EASTteam_name();
char *WESTteam_name();
/* global variables for team state*/
/*
These define the data that a team planner should know.
*/
typedef struct
{
int x;
int y;
int neighborhood[9];
int ball_direction;
} playerdata_t;
typedef enum {Q_EAST, Q_WEST} q_side_t;
typedef enum {GAME_RUNNING, GAME_WESTWON, GAME_EASTWON} game_state_t;
extern game_state_t game_state;
extern q_side_t q_side;
extern playerdata_t team_state[4];
extern int q_actions[4];
extern double reward;
#endif