forked from joegle/Light-Game
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinput.cpp
194 lines (170 loc) · 4.36 KB
/
input.cpp
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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
#include <iostream>
using namespace std;
void createWorld();
void readGrid();
void readWalls();
void readCubes();
void readBins();
void readLights();
void readSwitches();
void createGrid(double x, double y);
void createWall(double x, double y, double bin);
void createCube(double x, double y, double z, double r, double g, double b);
void createBin(double x, double y, double z, double r, double g, double b, double linkage);
void createLight(double x, double y, double z, double r, double g, double b);
void createSwitch(double x, double y, double z, double r, double g, double b, double linkage);
int main()
{
createWorld();
}
void createWorld()
{
//make the grid
readGrid();
//make the walls
readWalls();
//make the cubes
readCubes();
//make the bins
readBins();
//make the lights
readLights();
//make the switches
readSwitches();
}
void readGrid()
{
double x,y;
cin >> x >> y;
createGrid(x,y);
}
void readWalls()
{
double n, x, y, bin;
cin >> n;
for(int i = 0; i < n; i++)
{
cin >> x >> y >> bin;
createWall(x,y,bin);
}
}
void readCubes()
{
double n,x,y,z,r,g,b;
cin >> n;
for(int i = 0; i < n; i++)
{
cin >> x >> y >> z >> r >> g >> b;
createCube(x,y,z,r,g,b);
}
}
void readBins()
{
double n,x,y,z,r,g,b,linkage;
cin >> n;
for(int i = 0; i < n; i++)
{
cin >> x >> y >> z >> r >> g >> b >> linkage;
createBin(x,y,z,r,g,b,linkage);
}
}
void readLights()
{
double n,x,y,z,r,g,b;
cin >> n;
for(int i = 0; i < n; i++)
{
cin >> x >> y >> z >> r >> g >> b;
createLight(x,y,z,r,g,b);
}
}
void readSwitches()
{
double n,x,y,z,r,g,b,linkage;
cin >> n;
for(int i = 0; i < n; i++)
{
cin >> x >> y >> z >> r >> g >> b >> linkage;
createSwitch(x,y,z,r,g,b,linkage);
}
}
void createGrid(double x, double y)
{
cout << "Stub for create grid." << endl;
cout << "Inputs were the following: " << endl;
cout << "x: " << x << "\ny: " << y << endl;
cout << endl;
}
void createWall(double x, double y, double bin)
{
cout << "Stub for create wall." << endl;
cout << "Inputs were the following: " << endl;
cout << "x: " << x << "\ny: " << y << "\nbin: " << bin << endl;
cout << " The value represented by bin creates the following walls:" << endl;
if(bin - 8 >= 0)
{
bin-=8;
cout << " Top wall created." << endl;
}
if(bin - 4 >= 0)
{
bin-=4;
cout << " Right wall created." << endl;
}
if(bin - 2 >= 0)
{
bin-=2;
cout << " Bottom wall created." << endl;
}
if(bin - 1 >= 0)
{
bin-=1;
cout << " Left wall created." << endl;
}
cout << endl;
}
void createCube(double x, double y, double z, double r, double g, double b)
{
cout << "Stub for create cube." << endl;
cout << "Inputs were the following: " << endl;
cout << "x: " << x << "\ny: " << y << "\nr: " << r << "\ng: " << g << "\nb: " << b << endl;
cout << endl;
}
void createBin(double x, double y, double z, double r, double g, double b, double linkage)
{
cout << "Stub for create bin." << endl;
cout << "Inputs were the following: " << endl;
cout << "x: " << x << "\ny: " << y << "\nr: " << r << "\ng: " << g << "\nb: " << b << "\nlinkage: " << linkage << endl;
cout << endl;
}
void createLight(double x, double y, double z, double r, double g, double b)
{
cout << "Stub for create light." << endl;
cout << "Inputs were the following: " << endl;
cout << "x: " << x << "\ny: " << y << "\nr: " << r << "\ng: " << g << "\nb: " << b << endl;
cout << endl;
}
void createSwitch(double x, double y, double z, double r, double g, double b, double linkage)
{
cout << "Stub for create switch." << endl;
cout << "Inputs were the following: " << endl;
cout << "x: " << x << "\ny: " << y << "\nr: " << r << "\ng: " << g << "\nb: " << b << "\nlinkage: " << linkage << endl;
cout << endl;
}
/*
input file should be as follows
2 2 grid size: x y
4 num walls: n
0 0 0 wall details: x y binaryRepresentationOfWalls
0 1 0 // top right bottom left
0 2 0 // rockin it css style
0 3 0
1 num cubes: n
0 0 0 1 0 0 cube details: x y z r g b
1 num bins: n
0 0 0 1 0 0 0 bin details: x y z r g b linkedToCubeId
1 num lights: n
0 0 1 1 1 1 light details: x y z r g b
1 num switches: n
1 1 0 1 1 1 0 switch details: x y z r g b linkedToBinId
*/