-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathState.cpp
More file actions
43 lines (34 loc) · 792 Bytes
/
State.cpp
File metadata and controls
43 lines (34 loc) · 792 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
41
42
43
/*
* State.cpp
*
* Created on: Dec 29, 2012
* Author: jeff
*/
#include "State.h"
State::State(StateParent* _parent, StateContext* _context) :
parent(_parent),
context(_context) {
assert(parent);
assert(context);
}
void State::entryAction() {
// Do nothing by default, override by concrete states.
}
void State::exitAction() {
// Do nothing by default, override by concrete states.
}
StateParent* State::getParent() {
return parent;
}
StateContext* State::getStateContext() {
return context;
}
// Return blank display data by default, override by concrete states.
DisplayInfo State::getData() {
DisplayInfo info;
for (int i = 0; i < NUM_DIGITS; i++) {
info.val[i] = BLANK_DIGIT;
info.dp[i] = false;
}
return info;
}