ship.h
Go to the documentation of this file.00001
00002
00005 #ifndef SHIP_H
00006 #define SHIP_H
00007
00008 #include "vehicle_base.h"
00009 #include "engine_func.h"
00010 #include "engine_base.h"
00011 #include "economy_func.h"
00012
00013 void CcBuildShip(bool success, TileIndex tile, uint32 p1, uint32 p2);
00014 void RecalcShipStuff(Vehicle *v);
00015 void GetShipSpriteSize(EngineID engine, uint &width, uint &height);
00016
00025 struct Ship: public Vehicle {
00027 Ship() { this->type = VEH_SHIP; }
00028
00030 virtual ~Ship() { this->PreDestructor(); }
00031
00032 const char *GetTypeString() const { return "ship"; }
00033 void MarkDirty();
00034 void UpdateDeltaXY(Direction direction);
00035 ExpensesType GetExpenseType(bool income) const { return income ? EXPENSES_SHIP_INC : EXPENSES_SHIP_RUN; }
00036 void PlayLeaveStationSound() const;
00037 bool IsPrimaryVehicle() const { return true; }
00038 SpriteID GetImage(Direction direction) const;
00039 int GetDisplaySpeed() const { return this->cur_speed / 2; }
00040 int GetDisplayMaxSpeed() const { return this->max_speed / 2; }
00041 Money GetRunningCost() const;
00042 bool IsInDepot() const { return this->u.ship.state == TRACK_BIT_DEPOT; }
00043 void Tick();
00044 void OnNewDay();
00045 TileIndex GetOrderStationLocation(StationID station);
00046 bool FindClosestDepot(TileIndex *location, DestinationID *destination, bool *reverse);
00047 };
00048
00049 #endif