diff options
author | KUDr <kudr@openttd.org> | 2006-05-27 16:12:16 +0000 |
---|---|---|
committer | KUDr <kudr@openttd.org> | 2006-05-27 16:12:16 +0000 |
commit | 5e73dce0e71791b87e5b096a890578eefcc26639 (patch) | |
tree | e4580db6e03032a997fce1392929b7190dc3b03d /yapf/yapf.h | |
parent | 3d01010440440cfbffd1e5d3b0cf1f23f0503a76 (diff) | |
download | openttd-5e73dce0e71791b87e5b096a890578eefcc26639.tar.xz |
(svn r4987) Feature: Merged YAPF into trunk. Thanks to devs for continuous support and users for testing.
Diffstat (limited to 'yapf/yapf.h')
-rw-r--r-- | yapf/yapf.h | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/yapf/yapf.h b/yapf/yapf.h new file mode 100644 index 000000000..ae668ac25 --- /dev/null +++ b/yapf/yapf.h @@ -0,0 +1,54 @@ +/* $Id$ */ + +#ifndef YAPF_H +#define YAPF_H + +#include "../debug.h" + +Trackdir YapfChooseShipTrack(Vehicle *v, TileIndex tile, DiagDirection enterdir, TrackBits tracks); +Trackdir YapfChooseRoadTrack(Vehicle *v, TileIndex tile, DiagDirection enterdir); +Trackdir YapfChooseRailTrack(Vehicle *v, TileIndex tile, DiagDirection enterdir, TrackdirBits trackdirs); + +Depot* YapfFindNearestRoadDepot(const Vehicle *v); +bool YapfFindNearestRailDepotTwoWay(Vehicle *v, int max_distance, int reverse_penalty, TileIndex* depot_tile, bool* reversed); + +bool YapfCheckReverseTrain(Vehicle* v); + +void YapfNotifyTrackLayoutChange(TileIndex tile, Track track); + + +void* NpfBeginInterval(void); +int NpfEndInterval(void* perf); + +extern int _aystar_stats_open_size; +extern int _aystar_stats_closed_size; + + +/** Base struct for track followers. */ +typedef struct FollowTrack_t +{ + Vehicle* m_veh; + TileIndex m_old_tile; + Trackdir m_old_td; + TileIndex m_new_tile; + TrackdirBits m_new_td_bits; +// TrackdirBits m_red_td_bits; + DiagDirection m_exitdir; + bool m_is_tunnel; + int m_tunnel_tiles_skipped; +} FollowTrack_t; + +/** track followers */ +bool FollowTrackWater (FollowTrack_t *This, TileIndex old_tile, Trackdir old_td); +bool FollowTrackRoad (FollowTrack_t *This, TileIndex old_tile, Trackdir old_td); +bool FollowTrackRail (FollowTrack_t *This, TileIndex old_tile, Trackdir old_td); +bool FollowTrackWaterNo90(FollowTrack_t *This, TileIndex old_tile, Trackdir old_td); +bool FollowTrackRoadNo90 (FollowTrack_t *This, TileIndex old_tile, Trackdir old_td); +bool FollowTrackRailNo90 (FollowTrack_t *This, TileIndex old_tile, Trackdir old_td); + +enum { + YAPF_TILE_LENGTH = 100, + YAPF_TILE_CORNER_LENGTH = 71 +}; + +#endif /* YAPF_H */ |