MCPcopy Create free account
hub / github.com/SimHacker/micropolis / drawValve

Method drawValve

MicropolisCore/src/MicropolisEngine/src/update.cpp:183–227  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

181
182
183void Micropolis::drawValve()
184{
185 float r, c, i;
186
187 r = resValve;
188
189 if (r < -1500) {
190 r = -1500;
191 }
192
193 if (r > 1500) {
194 r = 1500;
195 }
196
197 c = comValve;
198
199 if (c < -1500) {
200 c = -1500;
201 }
202
203 if (c > 1500) {
204 c = 1500;
205 }
206
207 i = indValve;
208
209 if (i < -1500) {
210 i = -1500;
211 }
212
213 if (i > 1500) {
214 i = 1500;
215 }
216
217 if ((r != resLast) ||
218 (c != comLast) ||
219 (i != indLast)) {
220
221 resLast = (int)r;
222 comLast = (int)c;
223 indLast = (int)i;
224
225 setDemand(r, c, i);
226 }
227}
228
229
230void Micropolis::setDemand(float r, float c, float i)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected