# bridge.h

Go to the documentation of this file.

    00001 /* $Id: bridge.h 13688 2008-07-09 19:20:50Z rubidium $ */
    00002
    00005 #ifndef BRIDGE_H
    00006 #define BRIDGE_H
    00007
    00008 #include "gfx_type.h"
    00009 #include "direction_type.h"
    00010 #include "tile_cmd.h"
    00011
    00012 enum {
    00013   MAX_BRIDGES = 13
    00014 };
    00015
    00016 typedef uint BridgeType;
    00017
    00020 struct BridgeSpec {
    00021   Year avail_year;
    00022   byte min_length;
    00023   byte max_length;
    00024   uint16 price;
    00025   uint16 speed;
    00026   SpriteID sprite;
    00027   SpriteID pal;
    00028   StringID material;
    00029   StringID transport_name[2];
    00030   PalSpriteID **sprite_table;
    00031   byte flags;
    00032 };
    00033
    00034 extern BridgeSpec _bridge[MAX_BRIDGES];
    00035
    00036 Foundation GetBridgeFoundation(Slope tileh, Axis axis);
    00037 bool HasBridgeFlatRamp(Slope tileh, Axis axis);
    00038
    00039 static inline const BridgeSpec *GetBridgeSpec(BridgeType i)
    00040 {
    00041   assert(i < lengthof(_bridge));
    00042   return &_bridge[i];
    00043 }
    00044
    00045 void DrawBridgeMiddle(const TileInfo *ti);
    00046
    00047 bool CheckBridge_Stuff(BridgeType bridge_type, uint bridge_len, uint32 flags = 0);
    00048 int CalcBridgeLenCostFactor(int x);
    00049
    00050 void ResetBridges();
    00051
    00052 #endif /* BRIDGE_H */