| 627 | } |
| 628 | |
| 629 | void cResourceCount::Modify(cAvidaContext& ctx, const Apto::Array<double> & res_change) |
| 630 | { |
| 631 | assert(resource_count.GetSize() == res_change.GetSize()); |
| 632 | |
| 633 | DoUpdates(ctx); |
| 634 | for (int i = 0; i < resource_count.GetSize(); i++) { |
| 635 | resource_count[i] += res_change[i]; |
| 636 | assert(resource_count[i] >= 0.0); |
| 637 | } |
| 638 | } |
| 639 | |
| 640 | |
| 641 | void cResourceCount::Modify(cAvidaContext& ctx, int res_index, double change) |