# ship.h

Go to the documentation of this file.

    00001 /* $Id: ship.h 12037 2008-02-01 22:02:14Z glx $ */
    00002
    00005 #ifndef SHIP_H
    00006 #define SHIP_H
    00007
    00008 #include "vehicle_base.h"
    00009 #include "engine.h"
    00010 #include "economy_func.h"
    00011
    00012 void CcBuildShip(bool success, TileIndex tile, uint32 p1, uint32 p2);
    00013 void RecalcShipStuff(Vehicle *v);
    00014 void GetShipSpriteSize(EngineID engine, uint &width, uint &height);
    00015
    00024 struct Ship: public Vehicle {
    00026   Ship() { this->type = VEH_SHIP; }
    00027
    00029   virtual ~Ship() { this->PreDestructor(); }
    00030
    00031   const char *GetTypeString() const { return "ship"; }
    00032   void MarkDirty();
    00033   void UpdateDeltaXY(Direction direction);
    00034   ExpensesType GetExpenseType(bool income) const { return income ? EXPENSES_SHIP_INC : EXPENSES_SHIP_RUN; }
    00035   WindowClass GetVehicleListWindowClass() const { return WC_SHIPS_LIST; }
    00036   void PlayLeaveStationSound() const;
    00037   bool IsPrimaryVehicle() const { return true; }
    00038   int GetImage(Direction direction) const;
    00039   int GetDisplaySpeed() const { return this->cur_speed * 10 / 32; }
    00040   int GetDisplayMaxSpeed() const { return this->max_speed * 10 / 32; }
    00041   Money GetRunningCost() const { return ShipVehInfo(this->engine_type)->running_cost * _price.ship_running; }
    00042   bool IsInDepot() const { return this->u.ship.state == 0x80; }
    00043   void Tick();
    00044   void OnNewDay();
    00045 };
    00046
    00047 #endif /* SHIP_H */