1 /** @file triphistory.h */
6 #include "economy_type.h"
11 static const int NUM_TRIP_HISTORY_ENTRIES
= 10;
13 struct TripHistoryEntry
{
14 Money profit
; // Saved
16 int32 profit_change
; // Calculated
17 Ticks time_between_trips
; // Calculated
18 int32 time_between_trips_change
; // Calculated
20 TripHistoryEntry() : profit(0), ticks(0), profit_change(0), time_between_trips(0), time_between_trips_change(0) { };
23 /** Structure to hold data for each vehicle */
25 // a lot of saveload stuff for std::deque. So...
26 TripHistoryEntry entries
[NUM_TRIP_HISTORY_ENTRIES
];
30 Ticks avg_time_between_trips
;
34 avg_time_between_trips(0),
38 void AddValue(Money profit
, Ticks ticks
);
39 int32
FindPercentChange(float current_value
, float previous_value
);
41 int32
UpdateCalculated(bool update_entries
= false);
44 #endif /* TRIPHISTORY_H */