-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTimerUnit.h
More file actions
executable file
·38 lines (38 loc) · 1.15 KB
/
Copy pathTimerUnit.h
File metadata and controls
executable file
·38 lines (38 loc) · 1.15 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
class TimerUnit
{
Sprite LargeNumberSprite;
Sprite SmallNumberSprite;
Sprite CasingSprite;
char* Caption;
Font* CaptionFont;
POINT AbsCasingOrigin;
POINT RelCaptionOrigin;
POINT RelTimeOrigin;
int Status; //0 - OPEN AND READY, 1 - OPENING, 2 - CLOSING, 3 - CLOSED AND NOT READY
int StoredDigitArray[6];
int StoredMinutes;
int StoredSeconds;
int StoredSplit;
int CurrentMinutes;
int CurrentSeconds;
double CurrentSplit;
bool Running;
bool TimeUp;
void WrapAround();
void UpdateDigits();
void Draw(CDisplay& DisplayRef);
public:
TimerUnit() : Caption(NULL), Running(false), TimeUp(false), StoredMinutes(0), StoredSeconds(0), StoredSplit(0), CurrentMinutes(0), CurrentSeconds(0), CurrentSplit(0) {}
~TimerUnit() { if(Caption)delete [] Caption;}
void Initialize(int LargeNumberSpriteID, int SmallNumberSpriteID, int CasingSpriteID, int CaptionFontID);
void SetCaption(char* NewCaption);
void SetTime(int Minutes, int Seconds, int Split);
bool IsReadyToBeginCounting();
void Reset();
void Freeze();
void Open();
void Close();
void Unfreeze();
bool IsTimeUp();
void Update(int TimeDiff, CDisplay& DisplayRef);
};