-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathButton.h
More file actions
40 lines (27 loc) · 782 Bytes
/
Button.h
File metadata and controls
40 lines (27 loc) · 782 Bytes
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 __BUTTON_H__
#define __BUTTON_H__
#include "MapObject.h"
#include "Wall.h"
#include "EventCollision.h"
const int MAX_WALL_COUNT = 5;
class Button : public MapObject {
private:
int wall_count; // number of walls currently stored
Wall *p_wall[MAX_WALL_COUNT]; // array of stored walls
bool activated = false; // has the button been pressed
public:
Button();
// event handler
int eventHandler(df::Event *p_e);
// handle collision event
int eventCollision(const df::EventCollision *p_e);
// add a wall to be controlled by this button
int addWall(Wall *new_wall);
// remove a wall from this buttons control
int removeWall(Wall *rem_wall);
// activate all walls
void activateWalls();
// deactivate all walls
void deactivateWalls();
};
#endif