| 498 | } |
| 499 | |
| 500 | void cResourceCount::SetInflow(const cString& name, const double _inflow) |
| 501 | { |
| 502 | int id = GetResourceCountID(name); |
| 503 | if (id == -1) return; |
| 504 | |
| 505 | inflow_rate[id] = _inflow; |
| 506 | double step_inflow = _inflow * UPDATE_STEP; |
| 507 | double step_decay = pow(decay_rate[id], UPDATE_STEP); |
| 508 | |
| 509 | inflow_precalc(id, 0) = 0.0; |
| 510 | for (int i = 1; i <= PRECALC_DISTANCE; i++) { |
| 511 | inflow_precalc(id, i) = inflow_precalc(id, i-1) * step_decay + step_inflow; |
| 512 | } |
| 513 | } |
| 514 | |
| 515 | double cResourceCount::GetDecay(const cString& name) |
| 516 | { |
no outgoing calls
no test coverage detected