-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStatus.cpp
More file actions
118 lines (103 loc) · 3.69 KB
/
Copy pathStatus.cpp
File metadata and controls
118 lines (103 loc) · 3.69 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
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
// ********************************************************************************
/// <summary>
///
/// </summary>
/// <created>ʆϒʅ,20.06.2019</created>
/// <changed>ʆϒʅ,13.10.2019</changed>
// ********************************************************************************
#include "Packers.h"
#include "Status.h"
#include "Console.h"
Status::Status ( const unsigned char& mode )
{
state = u8".: demo ^.^ :.";
title = u8"status ^,^";
pointState = { SCREEN_W - 16, 1 };
pointTitle = { SCREEN_W - 15, 3 };
otherString [0] = u8"packers:";
otherString [1] = u8"age:";
otherString [2] = u8"resources->";
otherString [3] = u8"healthy:";
otherString [4] = u8"renewing:";
otherString [5] = u8"vanished:";
otherString [6] = u8"packages->";
otherString [7] = u8"have:";
otherString [8] = u8"need:";
otherPoints [0] = { SCREEN_W - 15, 5 };
otherPoints [1] = { SCREEN_W - 15, 7 };
otherPoints [2] = { SCREEN_W - 15, 10 };
otherPoints [3] = { SCREEN_W - 15, 12 };
otherPoints [4] = { SCREEN_W - 15, 15 };
otherPoints [5] = { SCREEN_W - 15, 18 };
otherPoints [6] = { SCREEN_W - 15, 21 };
otherPoints [7] = { SCREEN_W - 15, 23 };
otherPoints [8] = { SCREEN_W - 15, 26 };
packersState = 0;
agesIdentifier = mode;
agesStrings [0] = u8" Stone";
agesStrings [1] = u8" Middle";
agesStrings [2] = u8" Advanced";
agesStrings [3] = u8" Hollow";
agesStrings [4] = u8" Dirty";
healthyState = 0;
renewedState = 0;
vanishedState = 0;
haveState = 0;
needState = 0;
// game state
colourInserter ( state, F_bWHITE, pointState );
// statusBar
colourInserter ( title, F_bWHITE, pointTitle );
COORD coordinate { otherPoints [0] };
colourInserter ( otherString [0], F_bPURPLE, coordinate );
coordinate.X += 9;
colourInserter ( std::to_string ( packersState ), F_CYAN, coordinate );
coordinate = otherPoints [1];
colourInserter ( otherString [1], F_bPURPLE, coordinate );
coordinate.Y += 1;
colourInserter ( agesStrings [agesIdentifier], F_CYAN, coordinate );
colourInserter ( otherString [2], F_bWHITE, otherPoints [2] );
coordinate = otherPoints [3];
colourInserter ( otherString [3], F_GREEN, coordinate );
coordinate.X += 3;
coordinate.Y += 1;
colourInserter ( std::to_string ( healthyState ), F_CYAN, coordinate );
coordinate = otherPoints [4];
colourInserter ( otherString [4], F_YELLOW, coordinate );
coordinate.X += 3;
coordinate.Y += 1;
colourInserter ( std::to_string ( renewedState ), F_CYAN, coordinate );
coordinate = otherPoints [5];
colourInserter ( otherString [5], F_bRED, coordinate );
coordinate.X += 3;
coordinate.Y += 1;
colourInserter ( std::to_string ( vanishedState ), F_CYAN, coordinate );
colourInserter ( otherString [6], F_bWHITE, otherPoints [6] );
coordinate = otherPoints [7];
colourInserter ( otherString [7], F_bPURPLE, coordinate );
coordinate.X += 3;
coordinate.Y += 1;
colourInserter ( std::to_string ( haveState ), F_CYAN, coordinate );
coordinate = otherPoints [8];
colourInserter ( otherString [8], F_bPURPLE, coordinate );
coordinate.X += 3;
coordinate.Y += 1;
colourInserter ( std::to_string ( needState ), F_CYAN, coordinate );
//TODO add: random need setter
};
void Status::get ( const unsigned short& arg )
{
COORD coordinate { otherPoints [0] };
coordinate.X += 9;
packersState = arg;
colourInserter ( std::to_string ( packersState ), F_CYAN, coordinate );
}
void Status::setter ( const unsigned char& input )
{
//TODO add: a set of state setter
// update complete the state setter
COORD coordinate { otherPoints [1] };
coordinate.Y += 1;
colourInserter ( u8" ", F_CYAN, coordinate );
colourInserter ( agesStrings [input], F_CYAN, coordinate );
};