-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstagemaker.h
More file actions
63 lines (52 loc) · 1.55 KB
/
Copy pathstagemaker.h
File metadata and controls
63 lines (52 loc) · 1.55 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#ifndef STAGEMAKER_H
#define STAGEMAKER_H
#include <QPainter>
#include <vector>
#include <QDialog>
#include "ui_instructionrequest.h"
#include "instructionirequest.h"
namespace game {
class GameDialog;
// define what type of element is the cursor holding
enum SMakerObjectType{SMAKER_HOLDING_ALIEN_RED, SMAKER_HOLDING_ALIEN_BLUE,
SMAKER_HOLDING_ALIEN_HUNTER, SMAKER_HOLDING_ALIEN_DUMB,
SMAKER_HOLDING_INSTRUCTION_BOX, SMAKER_HOLDING_BARRIER_BLOCK,
SMAKER_HOLDING_LINE,
SMAKER_HOLDING_NONE};
// defines the placed object by cursor
struct SMakerPlacedObject{
SMakerPlacedObject() : connected(false){}
QRect hitBox;
SMakerObjectType type;
QPixmap pixmap;
// determine if the object is connect to another object (to define instructions of swarms)
bool connected;
QPoint connectedPoint;
QString instructions;
};
class StageMaker
{
public:
StageMaker(GameDialog* gDialog);
~StageMaker();
void init();
void draw(QPainter* p);
void buttonPressed();
void buttonReleased();
void clearAll();
void testStage();
// available objects template
std::map<SMakerObjectType, SMakerPlacedObject> objectTemplate;
QPoint lineOrigin;
// variables
QRect clearAllBtn;
QRect testStageBtn;
SMakerObjectType holdingObject;
GameDialog* gDialog;
private:
void drawInstructionBox(QPainter* p, const QRect& hitBox);
std::vector<SMakerPlacedObject> objects;
InstructionRequest req;
};
}
#endif // STAGEMAKER_H