-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathWorld.h
115 lines (97 loc) · 2.52 KB
/
World.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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#ifndef WORLD_H
#define WORLD_H
#include "Constants.h"
#include "Map.h"
#include "Types.h"
#include "Entity.h"
#include <vector>
#include "Beetle.h"
#include "Teleport.h"
/**
* Game Interface
* At each turn, you are given an instance of the World, and you can call any of
* the following methods to get information from the game, or do action on the
* game. Please read documentation of any method you have problem with that.
* Please do not change this class.
*/
class World
{
public:
virtual ~World() {};
/* game moves */
/**
* Changing the strategy of the roachs with the given antenna type
*
* @param t Antenna type of the roach (0 for single antenna and 1 for double antenna)
* @param left Condition of the top-left neighbour
* @param right Condition of the top-right neighbour
* @param front Condition of the front
* @param s The command given to the roach (You can check Move in types)
*/
virtual void changeStrategy(bool wing, CellState left, CellState right, CellState front, Move strategy) = 0;
/**
* Give command to a specific Beetle with the given id
*
* @param id Beetle id
* @param s The command given to the roach of Move type
*/
virtual void deterministicMove(Beetle &beetle, Move strategy) = 0;
/**
* Changes antenna type of the given roach
*
* @param roach Roach type
* @param c Antenna type
*/
virtual void changeType(Beetle &beetle, bool wing) = 0;
/**
* number of turns that passed as long as game started.
*
* @return turn number
*/
virtual int getCurrentTurn() = 0;
/**
*
* @return Amount of all turns
*/
virtual int getTotalTurns() = 0;
/**
* get the remaining time of the current turn.
*
* @return turn remaining time (ms)
*/
virtual long long getTurnRemainingTime() = 0;
/**
* get time limit of each turn.
*
* @return total turn time (ms)
*/
virtual long long getTurnTotalTime() = 0;
/**
* get ID of your team. it will be useful when you want to check if a node is yours or not.
*
* @return ID of your team
*/
virtual int getTeamId() = 0;
/**
*
* @return get score of team
*/
virtual int getMyScore() = 0;
/**
*
* @return get score of opponent team
*/
virtual int getOppScore() = 0;
/**
*
* @return get constants
*/
virtual Constants getConstants() const = 0;
/**
* get map of the game.
*
* @return a Map that represents the game board.
*/
virtual Map* getMap() = 0;
};
#endif /* WORLD_H */