summaryrefslogtreecommitdiff
path: root/src/vehicle.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-05-02 09:39:11 +0000
committerrubidium <rubidium@openttd.org>2007-05-02 09:39:11 +0000
commit951c74806f9e261e90cbd0eff2dd11172ad94b35 (patch)
tree9b8a7fbf387498c62c9649ba43171bc6f882dc3d /src/vehicle.h
parentdce7dcb6649dca7a05f5abc5b006822a05e06056 (diff)
downloadopenttd-951c74806f9e261e90cbd0eff2dd11172ad94b35.tar.xz
(svn r9765) -Codechange: constify some class functions.
Diffstat (limited to 'src/vehicle.h')
-rw-r--r--src/vehicle.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/vehicle.h b/src/vehicle.h
index 1b2be2eb1..904a9f9e5 100644
--- a/src/vehicle.h
+++ b/src/vehicle.h
@@ -352,7 +352,7 @@ struct Vehicle {
* Get a string 'representation' of the vehicle type.
* @return the string representation.
*/
- virtual const char* GetTypeString() = 0;
+ virtual const char* GetTypeString() const = 0;
/**
* Marks the vehicles to be redrawn and updates cached variables
@@ -370,12 +370,12 @@ struct Vehicle {
* Sets the expense type associated to this vehicle type
* @param income whether this is income or (running) expenses of the vehicle
*/
- virtual ExpensesType GetExpenseType(bool income) { return EXPENSES_OTHER; }
+ virtual ExpensesType GetExpenseType(bool income) const { return EXPENSES_OTHER; }
/**
* Invalidates the vehicle list window of this type of vehicle
*/
- virtual WindowClass GetVehicleListWindowClass() { return WC_NONE; }
+ virtual WindowClass GetVehicleListWindowClass() const { return WC_NONE; }
};
/**
@@ -400,7 +400,7 @@ struct SpecialVehicle : public Vehicle {
/** We want to 'destruct' the right class. */
virtual ~SpecialVehicle() {}
- const char *GetTypeString() { return "special vehicle"; }
+ const char *GetTypeString() const { return "special vehicle"; }
void UpdateDeltaXY(Direction direction);
};
@@ -419,7 +419,7 @@ struct DisasterVehicle : public Vehicle {
/** We want to 'destruct' the right class. */
virtual ~DisasterVehicle() {}
- const char *GetTypeString() { return "disaster vehicle"; }
+ const char *GetTypeString() const { return "disaster vehicle"; }
void UpdateDeltaXY(Direction direction);
};
@@ -438,7 +438,7 @@ struct InvalidVehicle : public Vehicle {
/** We want to 'destruct' the right class. */
virtual ~InvalidVehicle() {}
- const char *GetTypeString() { return "invalid vehicle"; }
+ const char *GetTypeString() const { return "invalid vehicle"; }
};
#define is_custom_sprite(x) (x >= 0xFD)