Codechange: initialise instance members

This commit is contained in:
Rubidium
2025-03-08 18:07:52 +01:00
committed by rubidium42
parent 0de7fd3c24
commit 2000cea235
28 changed files with 187 additions and 209 deletions

View File

@@ -21,17 +21,17 @@
* Only the cargo type of the most saturated linkgraph is taken into account.
*/
struct LinkProperties {
LinkProperties() : cargo(INVALID_CARGO), capacity(0), usage(0), planned(0), shared(false) {}
LinkProperties() {}
/** Return the usage of the link to display. */
uint Usage() const { return std::max(this->usage, this->planned); }
CargoType cargo; ///< Cargo type of the link.
uint capacity; ///< Capacity of the link.
uint usage; ///< Actual usage of the link.
uint planned; ///< Planned usage of the link.
uint32_t time; ///< Travel time of the link.
bool shared; ///< If this is a shared link to be drawn dashed.
CargoType cargo = INVALID_CARGO; ///< Cargo type of the link.
uint capacity = 0; ///< Capacity of the link.
uint usage = 0; ///< Actual usage of the link.
uint planned = 0; ///< Planned usage of the link.
uint32_t time = 0; ///< Travel time of the link.
bool shared = false; ///< If this is a shared link to be drawn dashed.
};
/**

View File

@@ -52,7 +52,7 @@ public:
* can only decrease or stay the same if you add more edges.
*/
class CapacityAnnotation : public Path {
int cached_annotation;
int cached_annotation = 0;
public: