| 1809 | |
| 1810 | |
| 1811 | Option<Resources> Resources::find(const Resources& targets) const |
| 1812 | { |
| 1813 | Resources total; |
| 1814 | |
| 1815 | foreach (const Resource& target, targets) { |
| 1816 | Option<Resources> found = find(target); |
| 1817 | |
| 1818 | // Each target needs to be found! |
| 1819 | if (found.isNone()) { |
| 1820 | return None(); |
| 1821 | } |
| 1822 | |
| 1823 | total += found.get(); |
| 1824 | } |
| 1825 | |
| 1826 | return total; |
| 1827 | } |
| 1828 | |
| 1829 | |
| 1830 | Try<Resources> Resources::apply(const ResourceConversion& conversion) const |