-
Notifications
You must be signed in to change notification settings - Fork 0
/
symmetry.h
51 lines (39 loc) · 1.15 KB
/
symmetry.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
#ifndef SYMMETRY_H
#define SYMMETRY_H
#include <cstdlib>
#include "map.h"
struct Bot;
struct State;
struct Symmetry;
struct SymmetryFinder {
static const uint8_t MapWater = 0x01;
static const uint8_t MapEnemyHill = 0x02;
static const uint8_t MapKnown = 0x20;
static const uint8_t MapKnownNoHill = 0x40;
static const uint8_t MapFingerprinted = 0x80;
SymmetryFinder(Bot & b);
~SymmetryFinder();
void init();
void run();
void update_map();
void compute_fingerprints();
bool do_find_fingerprint_symmetries(const Location & center);
void find_fingerprint_symmetries(const Location & center);
void add_candidate_symmetry(const Location & from, const Location & to, uint orientation);
bool check_symmetry(const Symmetry & s);
void recheck_symmetries();
void add_symmetry(const Symmetry & s);
void check_destroyed_hills();
void broadcast_hill(const Location & pos);
void add_possible_enemy_hill(const Location & pos);
bool have_seen(const Location & center, uint rel) const;
struct Data;
Bot & bot;
State & state;
Data & d;
Map<uint8_t> map;
bool newwater;
bool enemyhillschanged;
std::vector<Location> enemy_hills;
};
#endif // SYMMETRY_H