1 #pragma once
2 #ifndef CATA_SRC_VEH_UTILS_H
3 #define CATA_SRC_VEH_UTILS_H
4 
5 #include <iosfwd>
6 
7 #include "type_id.h"
8 
9 class Character;
10 class vehicle;
11 class vpart_info;
12 struct vehicle_part;
13 
14 namespace veh_utils
15 {
16 /** Calculates xp for interacting with given part. */
17 int calc_xp_gain( const vpart_info &vp, const skill_id &sk, const Character &who );
18 /**
19  * Returns a part on a given vehicle that a given character can repair.
20  * Prefers the most damaged parts that don't need replacements.
21  * If no such part exists, returns a null part.
22  */
23 vehicle_part &most_repairable_part( vehicle &veh, Character &who_arg,
24                                     bool only_repairable = false );
25 /**
26  * Repairs a given part on a given vehicle by given character.
27  * Awards xp and consumes components.
28  */
29 bool repair_part( vehicle &veh, vehicle_part &pt, Character &who_c, const std::string &variant );
30 } // namespace veh_utils
31 
32 #endif // CATA_SRC_VEH_UTILS_H
33