src/vehicle_base.h
branchNewGRF_ports
changeset 10184 fcf5fb2548eb
parent 6878 7d1ff2f621c7
child 10200 aba3af04cdbd
--- a/src/vehicle_base.h	Mon Apr 14 20:32:36 2008 +0000
+++ b/src/vehicle_base.h	Tue Apr 15 00:47:19 2008 +0000
@@ -17,9 +17,11 @@
 #include "date_type.h"
 #include "player_type.h"
 #include "oldpool.h"
-#include "order.h"
+#include "order_base.h"
 #include "cargopacket.h"
 #include "texteff.hpp"
+#include "group_type.h"
+#include "engine_type.h"
 #include "fsmblockmap.h"
 
 /** Road vehicle states */
@@ -223,9 +225,9 @@
 	                         // 0xfd == custom sprite, 0xfe == custom second head sprite
 	                         // 0xff == reserved for another custom sprite
 	uint16 cur_image;        // sprite number for this vehicle
-	byte sprite_width;       // width of vehicle sprite
-	byte sprite_height;      // height of vehicle sprite
-	byte z_height;           // z-height of vehicle sprite
+	byte x_extent;           // x-extent of vehicle bounding box
+	byte y_extent;           // y-extent of vehicle bounding box
+	byte z_extent;           // z-extent of vehicle bounding box
 	int8 x_offs;             // x offset for vehicle sprite
 	int8 y_offs;             // y offset for vehicle sprite
 	EngineID engine_type;
@@ -488,6 +490,30 @@
 	inline bool IsOrderListShared() const { return this->next_shared != NULL || this->prev_shared != NULL; };
 
 	bool NeedsAutorenewing(const Player *p) const;
+
+	/**
+	 * Check if the vehicle needs to go to a depot in near future (if a opportunity presents itself) for service or replacement.
+	 *
+	 * @see NeedsAutomaticServicing()
+	 * @return true if the vehicle should go to a depot if a opportunity presents itself.
+	 */
+	bool NeedsServicing() const;
+
+	/**
+	 * Checks if the current order should be interupted for a service-in-depot-order.
+	 * @see NeedsServicing()
+	 * @return true if the current order should be interupted.
+	 */
+	bool NeedsAutomaticServicing() const;
+
+	/**
+	 * Determine the location for the station where the vehicle goes to next.
+	 * Things done for example are allocating slots in a road stop or exact
+	 * location of the platform is determined for ships.
+	 * @param station the station to make the next location of the vehicle.
+	 * @return the location (tile) to aim for.
+	 */
+	virtual TileIndex GetOrderStationLocation(StationID station) { return INVALID_TILE; }
 };
 
 /**