tron@2268: /* $Id$ */ celestar@2262: celestar@2262: /** @file bridge.h Header file for bridges */ celestar@2262: celestar@2262: #ifndef BRIDGE_H celestar@2262: #define BRIDGE_H celestar@2262: rubidium@6872: #include "gfx_type.h" rubidium@6872: #include "direction_type.h" rubidium@6872: #include "tile_cmd.h" rubidium@6872: celestar@3359: enum { celestar@3359: MAX_BRIDGES = 13 celestar@3359: }; celestar@3359: richk@6878: typedef uint BridgeType; richk@6878: celestar@2262: /** Struct containing information about a single bridge type celestar@2262: */ richk@6878: struct BridgeSpec { richk@6878: Year avail_year; ///< the year where it becomes available richk@6878: byte min_length; ///< the minimum length (not counting start and end tile) richk@6878: byte max_length; ///< the maximum length (not counting start and end tile) richk@6878: uint16 price; ///< the price multiplier richk@6878: uint16 speed; ///< maximum travel speed richk@6878: SpriteID sprite; ///< the sprite which is used in the GUI richk@6878: SpriteID pal; ///< the palette which is used in the GUI richk@6878: StringID material; ///< the string that contains the bridge description richk@6878: StringID transport_name[2]; ///< description of the bridge, when built for road or rail richk@6878: PalSpriteID **sprite_table; ///< table of sprites for drawing the bridge richk@6878: byte flags; ///< bit 0 set: disable drawing of far pillars. rubidium@6574: }; celestar@2262: richk@6878: extern BridgeSpec _bridge[MAX_BRIDGES]; celestar@2262: richk@6743: Foundation GetBridgeFoundation(Slope tileh, Axis axis); rubidium@6872: bool HasBridgeFlatRamp(Slope tileh, Axis axis); tron@6467: richk@6878: static inline const BridgeSpec *GetBridgeSpec(BridgeType i) tron@6467: { tron@6467: assert(i < lengthof(_bridge)); tron@6467: return &_bridge[i]; tron@6467: } celestar@3355: richk@6743: void DrawBridgeMiddle(const TileInfo *ti); rubidium@6486: richk@6878: bool CheckBridge_Stuff(BridgeType bridge_type, uint bridge_len); rubidium@6872: int CalcBridgeLenCostFactor(int x); rubidium@6872: richk@6878: void ResetBridges(); richk@6878: celestar@2262: #endif /* BRIDGE_H */