* Get cost factors for a TownAction * @param action TownAction to get cost factor for. * @returns Cost factor. */
| 3389 | * @returns Cost factor. |
| 3390 | */ |
| 3391 | uint8_t GetTownActionCost(TownAction action) |
| 3392 | { |
| 3393 | /** |
| 3394 | * Factor in the cost of each town action. |
| 3395 | * @see TownActions |
| 3396 | */ |
| 3397 | static const uint8_t town_action_costs[] = { |
| 3398 | 2, 4, 9, 35, 48, 53, 117, 175 |
| 3399 | }; |
| 3400 | static_assert(std::size(town_action_costs) == to_underlying(TownAction::End)); |
| 3401 | |
| 3402 | assert(to_underlying(action) < std::size(town_action_costs)); |
| 3403 | return town_action_costs[to_underlying(action)]; |
| 3404 | } |
| 3405 | |
| 3406 | /** |
| 3407 | * Perform the "small advertising campaign" town action. |
no test coverage detected