-
Notifications
You must be signed in to change notification settings - Fork 0
/
Bot.h
67 lines (51 loc) · 1.15 KB
/
Bot.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
#ifndef BOT_H_
#define BOT_H_
#include "State.h"
struct Diffusion;
struct FoodSeeker;
struct HillDefense;
struct Module;
struct Offense;
struct OpportunisticAttack;
struct Scout;
struct SymmetryFinder;
struct Zoc;
struct Ant {
Location where;
bool assigneddirection;
int direction;
const int * dirperm;
Ant() : dirperm(0) {reset();}
void reset();
};
/*
This struct represents your bot in the game of Ants
*/
struct Bot
{
State state;
Bot(int argc, char * * argv);
~Bot();
float getargfloat(const std::string & key, float def);
void playGame(); //plays a single game of Ants
void makeMoves(); //makes moves for a single turn
void endTurn(); //indicates to the engine that it has made its moves
void update_ants();
uint myantidx_at(const Location & pos);
bool try_rotate_move(uint antidx);
void make_moves();
bool timeover();
struct Data;
Data & d;
Zoc & m_zoc;
SymmetryFinder & m_symmetry;
FoodSeeker & m_foodseeker;
Scout & m_scout;
HillDefense & m_hilldefense;
OpportunisticAttack & m_opportunisticattack;
Diffusion & m_diffusion;
Offense & m_offense;
Module & m_tactical;
std::vector<Ant> m_ants;
};
#endif //BOT_H_