| 97 | } |
| 98 | |
| 99 | bool Item::stackWith(ItemPtr const& item) { |
| 100 | uint64_t take = couldStack(item); |
| 101 | |
| 102 | if (take > 0 && item->consume(take)) { |
| 103 | m_count += take; |
| 104 | return true; |
| 105 | } else { |
| 106 | return false; |
| 107 | } |
| 108 | } |
| 109 | |
| 110 | bool Item::matches(ItemDescriptor const& descriptor, bool exactMatch) const { |
| 111 | return descriptor.name() == m_name && (!exactMatch || descriptor.parameters() == m_parameters); |
no test coverage detected