--- a/src/vehicle_base.h Wed Jan 09 18:11:12 2008 +0000
+++ b/src/vehicle_base.h Sun Feb 03 20:17:54 2008 +0000
@@ -15,6 +15,7 @@
#include "gfx_type.h"
#include "command_type.h"
#include "date_type.h"
+#include "player_type.h"
#include "oldpool.h"
#include "order.h"
#include "cargopacket.h"
@@ -106,7 +107,7 @@
TrackBitsByte track;
byte force_proceed;
RailTypeByte railtype;
- RailTypeMask compatible_railtypes;
+ RailTypes compatible_railtypes;
byte flags;
@@ -200,7 +201,7 @@
Vehicle *depot_list; // NOSAVE: linked list to tell what vehicles entered a depot during the last tick. Used by autoreplace
- StringID string_id; // Displayed string
+ char *name; ///< Name of vehicle
UnitID unitnumber; // unit number, for display purposes only
PlayerByte owner; // which player owns the vehicle?
@@ -425,6 +426,11 @@
virtual void Tick() {};
/**
+ * Calls the new day handler of the vehicle
+ */
+ virtual void OnNewDay() {};
+
+ /**
* Gets the running cost of a vehicle that can be sent into SetDParam for string processing.
* @return the vehicle's running cost
*/
@@ -455,6 +461,13 @@
* @return the first vehicle of the chain.
*/
inline Vehicle *First() const { return this->first; }
+
+ /**
+ * Check if we share our orders with another vehicle.
+ * This is done by checking the previous and next pointers in the shared chain.
+ * @return true if there are other vehicles sharing the same order
+ */
+ inline bool IsOrderListShared() const { return this->next_shared != NULL || this->prev_shared != NULL; };
};
/**