-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathContext.h
More file actions
40 lines (30 loc) · 1.29 KB
/
Copy pathContext.h
File metadata and controls
40 lines (30 loc) · 1.29 KB
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
#ifndef CONTEXT_H
#define CONTEXT_H
#include <string>
#include <vector>
#include "Entity.h"
class Context {
public:
std::string level;
//8x8 matrix who contains the levelelements
std::vector<std::vector<Entity*>> levelmatrix_ = std::vector<std::vector<Entity*>> (8,std::vector<Entity*>(8));
/////These flags keep track of some states the game can be in, they are mostly used to skip large parts of the code when false
/////this is done for optimalisation
//Gets set to true when the currentmissile hits and get removed, leads to "loading" a new missile in the catapult and updating the missilequeue
bool LoadNextMissile = false;
//Gets set to true when a levelelement gets hit, leads to code that updates there status and removes them when necessary
bool TargetsHit = false;
//Gets set to true when levelements get removed, leads to a levelUpdate in the LevelSystem
bool NeedLevelUpdate = false;
int targetcounter; // number of targets that aren't hit yet, when 0 the level is over
//basic timer, increases by 1 every update
int timer = 0;
/////Replay information
std::string replayFile;
std::vector<std::string> missiles;
std::vector<std::string> actions;
int seed;
bool replay = false;
int missileCounter = 0;
};
#endif