-
Notifications
You must be signed in to change notification settings - Fork 0
/
state.h
51 lines (36 loc) · 866 Bytes
/
state.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 STATE_H
#define STATE_H
#include <cstdlib>
#include <iostream>
#include <vector>
#include "bot.h"
#include "outstream.h"
enum Game_status {RUNNING, SUCCESS, FAILURE};
struct Object {Place pl; int wait; Action action; Dir dir; Loc dst; int durability; std::vector<Loc> path; };
struct State {
// dimensions
char part;
int rows;
int cols;
int num;
// map
std::vector <std::vector<Object> > map;
std::vector <std::vector<double> > smell;
// resurces
int lumber;
int apples;
int pumpkins;
// status
int time;
Game_status status;
// UI
bool play;
std::vector<int> prng_seq;
int prng_index;
};
void init(State &st, char part, int rows, int cols, int number);
void update(State &st, std::ostream &gamelog);
bool is_night(State &st);
int largest_structure(State &st);
int count_place(State &st, Place pl);
#endif