MCPcopy Create free account
hub / github.com/OpenApoc/OpenApoc / consume

Method consume

game/state/city/research.cpp:95–113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93}
94
95void ItemDependency::consume(StateRef<Base> base)
96{
97 for (auto &e : agentItemsConsumed)
98 {
99 int mult = e.first->type == AEquipmentType::Type::Ammo ? e.first->max_ammo : 1;
100 if (e.first->bioStorage)
101 {
102 base->inventoryBioEquipment[e.first.id] -= e.second * mult;
103 }
104 else
105 {
106 base->inventoryAgentEquipment[e.first.id] -= e.second * mult;
107 }
108 }
109 for (auto &e : vehicleItemsConsumed)
110 {
111 base->inventoryVehicleEquipment[e.first.id] -= e.second;
112 }
113}
114
115void ItemDependency::produceRemains(StateRef<Base> base)
116{

Callers 1

setResearchMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected