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@8123: #include "gfx_type.h" rubidium@8222: #include "direction_type.h" rubidium@8138: #include "tile_cmd.h" rubidium@8123: celestar@3359: enum { celestar@3359: MAX_BRIDGES = 13 celestar@3359: }; celestar@3359: belugas@8532: typedef uint BridgeType; belugas@8532: celestar@2262: /** Struct containing information about a single bridge type celestar@2262: */ belugas@8535: struct BridgeSpec { belugas@8540: Year avail_year; ///< the year where it becomes available belugas@8540: byte min_length; ///< the minimum length (not counting start and end tile) belugas@8540: byte max_length; ///< the maximum length (not counting start and end tile) belugas@8540: uint16 price; ///< the price multiplier belugas@8540: uint16 speed; ///< maximum travel speed belugas@8540: SpriteID sprite; ///< the sprite which is used in the GUI belugas@8540: SpriteID pal; ///< the palette which is used in the GUI belugas@8540: StringID material; ///< the string that contains the bridge description belugas@8540: StringID transport_name[2]; ///< description of the bridge, when built for road or rail belugas@8540: PalSpriteID **sprite_table; ///< table of sprites for drawing the bridge belugas@8540: byte flags; ///< bit 0 set: disable drawing of far pillars. rubidium@6248: }; celestar@2262: belugas@8535: extern BridgeSpec _bridge[MAX_BRIDGES]; celestar@2262: rubidium@7335: Foundation GetBridgeFoundation(Slope tileh, Axis axis); frosch@8379: bool HasBridgeFlatRamp(Slope tileh, Axis axis); tron@6141: belugas@8535: static inline const BridgeSpec *GetBridgeSpec(BridgeType i) tron@6141: { tron@6141: assert(i < lengthof(_bridge)); tron@6141: return &_bridge[i]; tron@6141: } celestar@3355: rubidium@7318: void DrawBridgeMiddle(const TileInfo *ti); rubidium@6160: belugas@8532: bool CheckBridge_Stuff(BridgeType bridge_type, uint bridge_len); rubidium@8119: int CalcBridgeLenCostFactor(int x); rubidium@8119: belugas@8489: void ResetBridges(); belugas@8489: celestar@2262: #endif /* BRIDGE_H */