for a given structure, return a pointer to its module stat */
| 5454 | |
| 5455 | /*for a given structure, return a pointer to its module stat */ |
| 5456 | STRUCTURE_STATS *getModuleStat(const STRUCTURE *psStruct) |
| 5457 | { |
| 5458 | ASSERT_OR_RETURN(nullptr, psStruct != nullptr, "Invalid structure pointer"); |
| 5459 | |
| 5460 | switch (psStruct->pStructureType->type) |
| 5461 | { |
| 5462 | case REF_POWER_GEN: |
| 5463 | return &asStructureStats[powerModuleStat]; |
| 5464 | case REF_FACTORY: |
| 5465 | case REF_VTOL_FACTORY: |
| 5466 | return &asStructureStats[factoryModuleStat]; |
| 5467 | case REF_RESEARCH: |
| 5468 | return &asStructureStats[researchModuleStat]; |
| 5469 | default: |
| 5470 | //no other structures can have modules attached |
| 5471 | return nullptr; |
| 5472 | } |
| 5473 | } |
| 5474 | |
| 5475 | /** |
| 5476 | * Count the artillery and VTOL droids assigned to a structure. |
no test coverage detected