-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathGlobalState.hpp
48 lines (37 loc) · 929 Bytes
/
GlobalState.hpp
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
//
// GlobalState.hpp
// HaxClient
//
// Created by Andrej Karadzic on 11/27/15.
// Copyright © 2015 Andrej Karadzic. All rights reserved.
//
#ifndef GlobalState_hpp
#define GlobalState_hpp
#include "Communicator.hpp"
using std::string;
class Communicator;
class GlobalState {
int myTeam;
int score[2];
char *parseConstants(char *message);
char *parseScore(char *message);
char *parseBall(char *message);
char *parsePlayer(char *message, player *p);
void initGoals();
public:
Communicator *comm;
double constPlayerRadius, constKickerRadius, constBallRadius, constPostRadius,
constPostY, constMaxY, constMaxX;
std::map<int, player> myPlayers;
std::map<int, player> oppPlayers;
player myPlayer;
Point ballPos;
Vector ballVel;
goal myGoal;
goal oppGoal;
GlobalState(Communicator *comm);
void updateState();
int myScore();
int oppScore();
};
#endif /* GlobalState_hpp */