-
Notifications
You must be signed in to change notification settings - Fork 1
/
pack_parts.h
98 lines (83 loc) · 2.07 KB
/
pack_parts.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
#ifndef pack_parts_h
#define pack_parts_h
#include "Arduino.h"
#include <ProtonPack.h>
class Powercell: public PackComponent {
public:
Powercell(int offset);
void onUpdate(Pack pack);
void onPackInitStart(Pack pack);
void onPackInitComplete(Pack pack);
void reset(Pack pack);
protected:
const static int _MAX_BRIGHTNESS = 2000;
int _current_led;
bool _initializing;
};
class Cyclotron: public PackComponent {
public:
Cyclotron(int offset);
int _last_switched_at;
int _current_led;
int _current_brightness;
virtual void onUpdate(Pack pack);
virtual void reset(Pack pack);
};
class Graph: public PackComponent {
public:
Graph(int offset);
void onUpdate(Pack pack);
void reset(Pack pack);
void onPackInitStart(Pack pack);
void onPackInitComplete(Pack pack);
void onFiringStart(Pack pack);
void onFiringStop(Pack pack);
protected:
int _iteration;
int _direction;
int _fill_pos;
bool _is_firing;
bool _is_initializing;
};
class Nozzle: public PackComponent {
public:
Nozzle(int offset);
void onUpdate(Pack pack);
void onFiringStart(Pack pack);
void onFiringStop(Pack pack);
void reset(Pack pack);
protected:
bool _is_firing;
};
class WandLights: public PackComponent {
public:
WandLights(int offset);
void onUpdate(Pack pack);
void onFiringStart(Pack pack);
void onFiringStop(Pack pack);
void onPackInitStart(Pack pack);
void onPackInitComplete(Pack pack);
void reset(Pack pack);
protected:
const static int SLO_BLO = 0;
const static int TOP_INDICATOR = 1;
const static int FRONT_LIGHT = 2;
const static int INTERNAL_LIGHT = 3;
bool _is_on;
bool _is_initializing;
bool _is_firing;
};
class Sound: public PackListener {
public:
Sound();
void onFiringStart(Pack pack);
void onFiringStop(Pack pack);
void onPackInitStart(Pack pack);
void onPackInitComplete(Pack pack);
void reset(Pack pack);
protected:
const static int POWER_RELAY = 4;
const static int FIRING_START_RELAY = 5;
const static int FIRING_STOP_RELAY = 6;
};
#endif