| 1005 | |
| 1006 | |
| 1007 | bool detectOverlappingSetAndRangeResources( |
| 1008 | const vector<Resources>& resources) |
| 1009 | { |
| 1010 | // If the sum of quantities of each `Resources` is not equal to the quantities |
| 1011 | // of the sum of `Resources`, then there is some overlap in ranges or sets. |
| 1012 | ResourceQuantities totalQuantities; |
| 1013 | Resources totalResources; |
| 1014 | |
| 1015 | foreach (const Resources& resources_, resources) { |
| 1016 | totalQuantities += ResourceQuantities::fromResources(resources_); |
| 1017 | totalResources += resources_; |
| 1018 | } |
| 1019 | |
| 1020 | return totalQuantities != ResourceQuantities::fromResources(totalResources); |
| 1021 | } |
| 1022 | |
| 1023 | namespace internal { |
| 1024 |
no outgoing calls