src/yapf/yapf.h
author skidd13
Sun, 02 Dec 2007 21:43:16 +0000
changeset 8004 1c54bc6f4bdf
parent 7211 ebabbe55f70e
child 8636 9dc7e26247b7
permissions -rw-r--r--
(svn r11563) -Codechange: Align the preprocessor code in stdafx.h with tabs
3900
2c84ed52709d (svn r4987) Feature: Merged YAPF into trunk. Thanks to devs for continuous support and users for testing.
KUDr
parents:
diff changeset
     1
/* $Id$ */
2c84ed52709d (svn r4987) Feature: Merged YAPF into trunk. Thanks to devs for continuous support and users for testing.
KUDr
parents:
diff changeset
     2
6121
2aae24b0881f (svn r8857) -Documentation: Added some doxygen @file tags, repaired others (the @file tag MUST be found before any line of code, that includes preprocessor directives).
celestar
parents: 5587
diff changeset
     3
/** @file yapf.h */
2aae24b0881f (svn r8857) -Documentation: Added some doxygen @file tags, repaired others (the @file tag MUST be found before any line of code, that includes preprocessor directives).
celestar
parents: 5587
diff changeset
     4
3900
2c84ed52709d (svn r4987) Feature: Merged YAPF into trunk. Thanks to devs for continuous support and users for testing.
KUDr
parents:
diff changeset
     5
#ifndef  YAPF_H
2c84ed52709d (svn r4987) Feature: Merged YAPF into trunk. Thanks to devs for continuous support and users for testing.
KUDr
parents:
diff changeset
     6
#define  YAPF_H
2c84ed52709d (svn r4987) Feature: Merged YAPF into trunk. Thanks to devs for continuous support and users for testing.
KUDr
parents:
diff changeset
     7
2c84ed52709d (svn r4987) Feature: Merged YAPF into trunk. Thanks to devs for continuous support and users for testing.
KUDr
parents:
diff changeset
     8
#include "../debug.h"
2c84ed52709d (svn r4987) Feature: Merged YAPF into trunk. Thanks to devs for continuous support and users for testing.
KUDr
parents:
diff changeset
     9
4462
d67a579a5452 (svn r6245) -Add: added comments for all YAPF C interface functions (yapf.h) used by other modules, added FollowTrackInit() into YAPF track followers.
KUDr
parents: 3977
diff changeset
    10
/** Finds the best path for given ship.
4549
106ed18a7675 (svn r6381) -Cleanup: make the '/* */' comments that span multiple lines more uniform.
rubidium
parents: 4462
diff changeset
    11
 * @param v        the ship that needs to find a path
106ed18a7675 (svn r6381) -Cleanup: make the '/* */' comments that span multiple lines more uniform.
rubidium
parents: 4462
diff changeset
    12
 * @param tile     the tile to find the path from (should be next tile the ship is about to enter)
106ed18a7675 (svn r6381) -Cleanup: make the '/* */' comments that span multiple lines more uniform.
rubidium
parents: 4462
diff changeset
    13
 * @param enterdir diagonal direction which the ship will enter this new tile from
106ed18a7675 (svn r6381) -Cleanup: make the '/* */' comments that span multiple lines more uniform.
rubidium
parents: 4462
diff changeset
    14
 * @param tracks   available tracks on the new tile (to choose from)
106ed18a7675 (svn r6381) -Cleanup: make the '/* */' comments that span multiple lines more uniform.
rubidium
parents: 4462
diff changeset
    15
 * @return         the best trackdir for next turn or INVALID_TRACKDIR if the path could not be found
4462
d67a579a5452 (svn r6245) -Add: added comments for all YAPF C interface functions (yapf.h) used by other modules, added FollowTrackInit() into YAPF track followers.
KUDr
parents: 3977
diff changeset
    16
 */
3900
2c84ed52709d (svn r4987) Feature: Merged YAPF into trunk. Thanks to devs for continuous support and users for testing.
KUDr
parents:
diff changeset
    17
Trackdir YapfChooseShipTrack(Vehicle *v, TileIndex tile, DiagDirection enterdir, TrackBits tracks);
4462
d67a579a5452 (svn r6245) -Add: added comments for all YAPF C interface functions (yapf.h) used by other modules, added FollowTrackInit() into YAPF track followers.
KUDr
parents: 3977
diff changeset
    18
d67a579a5452 (svn r6245) -Add: added comments for all YAPF C interface functions (yapf.h) used by other modules, added FollowTrackInit() into YAPF track followers.
KUDr
parents: 3977
diff changeset
    19
/** Finds the best path for given road vehicle.
4549
106ed18a7675 (svn r6381) -Cleanup: make the '/* */' comments that span multiple lines more uniform.
rubidium
parents: 4462
diff changeset
    20
 * @param v        the RV that needs to find a path
106ed18a7675 (svn r6381) -Cleanup: make the '/* */' comments that span multiple lines more uniform.
rubidium
parents: 4462
diff changeset
    21
 * @param tile     the tile to find the path from (should be next tile the RV is about to enter)
106ed18a7675 (svn r6381) -Cleanup: make the '/* */' comments that span multiple lines more uniform.
rubidium
parents: 4462
diff changeset
    22
 * @param enterdir diagonal direction which the RV will enter this new tile from
106ed18a7675 (svn r6381) -Cleanup: make the '/* */' comments that span multiple lines more uniform.
rubidium
parents: 4462
diff changeset
    23
 * @return         the best trackdir for next turn or INVALID_TRACKDIR if the path could not be found
106ed18a7675 (svn r6381) -Cleanup: make the '/* */' comments that span multiple lines more uniform.
rubidium
parents: 4462
diff changeset
    24
 */
3900
2c84ed52709d (svn r4987) Feature: Merged YAPF into trunk. Thanks to devs for continuous support and users for testing.
KUDr
parents:
diff changeset
    25
Trackdir YapfChooseRoadTrack(Vehicle *v, TileIndex tile, DiagDirection enterdir);
4462
d67a579a5452 (svn r6245) -Add: added comments for all YAPF C interface functions (yapf.h) used by other modules, added FollowTrackInit() into YAPF track followers.
KUDr
parents: 3977
diff changeset
    26
d67a579a5452 (svn r6245) -Add: added comments for all YAPF C interface functions (yapf.h) used by other modules, added FollowTrackInit() into YAPF track followers.
KUDr
parents: 3977
diff changeset
    27
/** Finds the best path for given train.
4549
106ed18a7675 (svn r6381) -Cleanup: make the '/* */' comments that span multiple lines more uniform.
rubidium
parents: 4462
diff changeset
    28
 * @param v        the train that needs to find a path
106ed18a7675 (svn r6381) -Cleanup: make the '/* */' comments that span multiple lines more uniform.
rubidium
parents: 4462
diff changeset
    29
 * @param tile     the tile to find the path from (should be next tile the train is about to enter)
106ed18a7675 (svn r6381) -Cleanup: make the '/* */' comments that span multiple lines more uniform.
rubidium
parents: 4462
diff changeset
    30
 * @param enterdir diagonal direction which the RV will enter this new tile from
6484
79156627e1ba (svn r9665) -Documentation: Doxygen corrections,errors, corrections of corrections...
belugas
parents: 6248
diff changeset
    31
 * @param tracks   available trackdirs on the new tile (to choose from)
79156627e1ba (svn r9665) -Documentation: Doxygen corrections,errors, corrections of corrections...
belugas
parents: 6248
diff changeset
    32
 * @param path_not_found [out] true is returned if no path can be found (returned Trackdir is only a 'guess')
4549
106ed18a7675 (svn r6381) -Cleanup: make the '/* */' comments that span multiple lines more uniform.
rubidium
parents: 4462
diff changeset
    33
 * @return         the best trackdir for next turn or INVALID_TRACKDIR if the path could not be found
106ed18a7675 (svn r6381) -Cleanup: make the '/* */' comments that span multiple lines more uniform.
rubidium
parents: 4462
diff changeset
    34
 */
5587
167d9a91ef02 (svn r8038) -Merge: the cpp branch. Effort of KUDr, Celestar, glx, Smoovius, stillunknown and pv2b.
rubidium
parents: 5475
diff changeset
    35
Trackdir YapfChooseRailTrack(Vehicle *v, TileIndex tile, DiagDirection enterdir, TrackBits tracks, bool *path_not_found);
3900
2c84ed52709d (svn r4987) Feature: Merged YAPF into trunk. Thanks to devs for continuous support and users for testing.
KUDr
parents:
diff changeset
    36
4462
d67a579a5452 (svn r6245) -Add: added comments for all YAPF C interface functions (yapf.h) used by other modules, added FollowTrackInit() into YAPF track followers.
KUDr
parents: 3977
diff changeset
    37
/** Used by RV multistop feature to find the nearest road stop that has a free slot.
4549
106ed18a7675 (svn r6381) -Cleanup: make the '/* */' comments that span multiple lines more uniform.
rubidium
parents: 4462
diff changeset
    38
 * @param v      RV (its current tile will be the origin)
106ed18a7675 (svn r6381) -Cleanup: make the '/* */' comments that span multiple lines more uniform.
rubidium
parents: 4462
diff changeset
    39
 * @param tile   destination tile
106ed18a7675 (svn r6381) -Cleanup: make the '/* */' comments that span multiple lines more uniform.
rubidium
parents: 4462
diff changeset
    40
 * @return       distance from origin tile to the destination (number of road tiles) or UINT_MAX if path not found
106ed18a7675 (svn r6381) -Cleanup: make the '/* */' comments that span multiple lines more uniform.
rubidium
parents: 4462
diff changeset
    41
 */
3915
914d45c135c7 (svn r5033) -CodeChange: [YAPF] RoadFindPathToStop() can now use YAPF for multistop handling.
KUDr
parents: 3900
diff changeset
    42
uint YapfRoadVehDistanceToTile(const Vehicle* v, TileIndex tile);
914d45c135c7 (svn r5033) -CodeChange: [YAPF] RoadFindPathToStop() can now use YAPF for multistop handling.
KUDr
parents: 3900
diff changeset
    43
4462
d67a579a5452 (svn r6245) -Add: added comments for all YAPF C interface functions (yapf.h) used by other modules, added FollowTrackInit() into YAPF track followers.
KUDr
parents: 3977
diff changeset
    44
/** Used when user sends RV to the nearest depot or if RV needs servicing.
4549
106ed18a7675 (svn r6381) -Cleanup: make the '/* */' comments that span multiple lines more uniform.
rubidium
parents: 4462
diff changeset
    45
 * Returns the nearest depot (or NULL if depot was not found).
106ed18a7675 (svn r6381) -Cleanup: make the '/* */' comments that span multiple lines more uniform.
rubidium
parents: 4462
diff changeset
    46
 */
3900
2c84ed52709d (svn r4987) Feature: Merged YAPF into trunk. Thanks to devs for continuous support and users for testing.
KUDr
parents:
diff changeset
    47
Depot* YapfFindNearestRoadDepot(const Vehicle *v);
4462
d67a579a5452 (svn r6245) -Add: added comments for all YAPF C interface functions (yapf.h) used by other modules, added FollowTrackInit() into YAPF track followers.
KUDr
parents: 3977
diff changeset
    48
d67a579a5452 (svn r6245) -Add: added comments for all YAPF C interface functions (yapf.h) used by other modules, added FollowTrackInit() into YAPF track followers.
KUDr
parents: 3977
diff changeset
    49
/** Used when user sends train to the nearest depot or if train needs servicing.
6484
79156627e1ba (svn r9665) -Documentation: Doxygen corrections,errors, corrections of corrections...
belugas
parents: 6248
diff changeset
    50
 * @param v            train that needs to go to some depot
79156627e1ba (svn r9665) -Documentation: Doxygen corrections,errors, corrections of corrections...
belugas
parents: 6248
diff changeset
    51
 * @param max_distance max distance (number of track tiles) from the current train position
4549
106ed18a7675 (svn r6381) -Cleanup: make the '/* */' comments that span multiple lines more uniform.
rubidium
parents: 4462
diff changeset
    52
 *                  (used also as optimization - the pathfinder can stop path finding if max_distance
106ed18a7675 (svn r6381) -Cleanup: make the '/* */' comments that span multiple lines more uniform.
rubidium
parents: 4462
diff changeset
    53
 *                  was reached and no depot was seen)
6484
79156627e1ba (svn r9665) -Documentation: Doxygen corrections,errors, corrections of corrections...
belugas
parents: 6248
diff changeset
    54
 * @param reverse_penalty penalty that should be added for the path that requires reversing the train first
79156627e1ba (svn r9665) -Documentation: Doxygen corrections,errors, corrections of corrections...
belugas
parents: 6248
diff changeset
    55
 * @param depot_tile   receives the depot tile if depot was found
79156627e1ba (svn r9665) -Documentation: Doxygen corrections,errors, corrections of corrections...
belugas
parents: 6248
diff changeset
    56
 * @param reversed     receives true if train needs to reversed first
4549
106ed18a7675 (svn r6381) -Cleanup: make the '/* */' comments that span multiple lines more uniform.
rubidium
parents: 4462
diff changeset
    57
 * @return       the true if depot was found.
106ed18a7675 (svn r6381) -Cleanup: make the '/* */' comments that span multiple lines more uniform.
rubidium
parents: 4462
diff changeset
    58
 */
3900
2c84ed52709d (svn r4987) Feature: Merged YAPF into trunk. Thanks to devs for continuous support and users for testing.
KUDr
parents:
diff changeset
    59
bool YapfFindNearestRailDepotTwoWay(Vehicle *v, int max_distance, int reverse_penalty, TileIndex* depot_tile, bool* reversed);
2c84ed52709d (svn r4987) Feature: Merged YAPF into trunk. Thanks to devs for continuous support and users for testing.
KUDr
parents:
diff changeset
    60
4462
d67a579a5452 (svn r6245) -Add: added comments for all YAPF C interface functions (yapf.h) used by other modules, added FollowTrackInit() into YAPF track followers.
KUDr
parents: 3977
diff changeset
    61
/** Returns true if it is better to reverse the train before leaving station */
3900
2c84ed52709d (svn r4987) Feature: Merged YAPF into trunk. Thanks to devs for continuous support and users for testing.
KUDr
parents:
diff changeset
    62
bool YapfCheckReverseTrain(Vehicle* v);
2c84ed52709d (svn r4987) Feature: Merged YAPF into trunk. Thanks to devs for continuous support and users for testing.
KUDr
parents:
diff changeset
    63
4462
d67a579a5452 (svn r6245) -Add: added comments for all YAPF C interface functions (yapf.h) used by other modules, added FollowTrackInit() into YAPF track followers.
KUDr
parents: 3977
diff changeset
    64
/** Use this function to notify YAPF that track layout (or signal configuration) has change */
3900
2c84ed52709d (svn r4987) Feature: Merged YAPF into trunk. Thanks to devs for continuous support and users for testing.
KUDr
parents:
diff changeset
    65
void YapfNotifyTrackLayoutChange(TileIndex tile, Track track);
2c84ed52709d (svn r4987) Feature: Merged YAPF into trunk. Thanks to devs for continuous support and users for testing.
KUDr
parents:
diff changeset
    66
4462
d67a579a5452 (svn r6245) -Add: added comments for all YAPF C interface functions (yapf.h) used by other modules, added FollowTrackInit() into YAPF track followers.
KUDr
parents: 3977
diff changeset
    67
/** performance measurement helpers */
6247
7d81e3a5d803 (svn r9050) -Codechange: Foo(void) -> Foo()
rubidium
parents: 6121
diff changeset
    68
void* NpfBeginInterval();
3900
2c84ed52709d (svn r4987) Feature: Merged YAPF into trunk. Thanks to devs for continuous support and users for testing.
KUDr
parents:
diff changeset
    69
int NpfEndInterval(void* perf);
2c84ed52709d (svn r4987) Feature: Merged YAPF into trunk. Thanks to devs for continuous support and users for testing.
KUDr
parents:
diff changeset
    70
4462
d67a579a5452 (svn r6245) -Add: added comments for all YAPF C interface functions (yapf.h) used by other modules, added FollowTrackInit() into YAPF track followers.
KUDr
parents: 3977
diff changeset
    71
3900
2c84ed52709d (svn r4987) Feature: Merged YAPF into trunk. Thanks to devs for continuous support and users for testing.
KUDr
parents:
diff changeset
    72
extern int _aystar_stats_open_size;
2c84ed52709d (svn r4987) Feature: Merged YAPF into trunk. Thanks to devs for continuous support and users for testing.
KUDr
parents:
diff changeset
    73
extern int _aystar_stats_closed_size;
2c84ed52709d (svn r4987) Feature: Merged YAPF into trunk. Thanks to devs for continuous support and users for testing.
KUDr
parents:
diff changeset
    74
2c84ed52709d (svn r4987) Feature: Merged YAPF into trunk. Thanks to devs for continuous support and users for testing.
KUDr
parents:
diff changeset
    75
4462
d67a579a5452 (svn r6245) -Add: added comments for all YAPF C interface functions (yapf.h) used by other modules, added FollowTrackInit() into YAPF track followers.
KUDr
parents: 3977
diff changeset
    76
/** Track followers. They should help whenever any new code will need to walk through
4549
106ed18a7675 (svn r6381) -Cleanup: make the '/* */' comments that span multiple lines more uniform.
rubidium
parents: 4462
diff changeset
    77
 * tracks, road or water tiles (pathfinders, signal controllers, vehicle controllers).
106ed18a7675 (svn r6381) -Cleanup: make the '/* */' comments that span multiple lines more uniform.
rubidium
parents: 4462
diff changeset
    78
 * It is an attempt to introduce API that should simplify tasks listed above.
106ed18a7675 (svn r6381) -Cleanup: make the '/* */' comments that span multiple lines more uniform.
rubidium
parents: 4462
diff changeset
    79
 * If you will need to use it:
106ed18a7675 (svn r6381) -Cleanup: make the '/* */' comments that span multiple lines more uniform.
rubidium
parents: 4462
diff changeset
    80
 *   1. allocate/declare FollowTrack_t structure;
106ed18a7675 (svn r6381) -Cleanup: make the '/* */' comments that span multiple lines more uniform.
rubidium
parents: 4462
diff changeset
    81
 *   2. call FollowTrackInit() and provide vehicle (if relevant)
106ed18a7675 (svn r6381) -Cleanup: make the '/* */' comments that span multiple lines more uniform.
rubidium
parents: 4462
diff changeset
    82
 *   3. call one of 6 FollowTrackXxxx() APIs below
106ed18a7675 (svn r6381) -Cleanup: make the '/* */' comments that span multiple lines more uniform.
rubidium
parents: 4462
diff changeset
    83
 *   4. check return value (if true then continue else stop)
106ed18a7675 (svn r6381) -Cleanup: make the '/* */' comments that span multiple lines more uniform.
rubidium
parents: 4462
diff changeset
    84
 *   5. look at FollowTrack_t structure for the result
106ed18a7675 (svn r6381) -Cleanup: make the '/* */' comments that span multiple lines more uniform.
rubidium
parents: 4462
diff changeset
    85
 *   6. optionally repeat steps 3..5
106ed18a7675 (svn r6381) -Cleanup: make the '/* */' comments that span multiple lines more uniform.
rubidium
parents: 4462
diff changeset
    86
 *   7. in case of troubles contact KUDr
106ed18a7675 (svn r6381) -Cleanup: make the '/* */' comments that span multiple lines more uniform.
rubidium
parents: 4462
diff changeset
    87
 */
4462
d67a579a5452 (svn r6245) -Add: added comments for all YAPF C interface functions (yapf.h) used by other modules, added FollowTrackInit() into YAPF track followers.
KUDr
parents: 3977
diff changeset
    88
3900
2c84ed52709d (svn r4987) Feature: Merged YAPF into trunk. Thanks to devs for continuous support and users for testing.
KUDr
parents:
diff changeset
    89
/** Base struct for track followers. */
6248
e4a2ed7e5613 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6247
diff changeset
    90
struct FollowTrack_t
3900
2c84ed52709d (svn r4987) Feature: Merged YAPF into trunk. Thanks to devs for continuous support and users for testing.
KUDr
parents:
diff changeset
    91
{
7211
ebabbe55f70e (svn r10489) -Codechange [YAPF]: FollowTrack_t now has new data member - m_err. It indicates the reason why the given track/trackdir can't be followed when method CFollowTrackT<>::Follow() returned false.
KUDr
parents: 6484
diff changeset
    92
	enum ErrorCode {
ebabbe55f70e (svn r10489) -Codechange [YAPF]: FollowTrack_t now has new data member - m_err. It indicates the reason why the given track/trackdir can't be followed when method CFollowTrackT<>::Follow() returned false.
KUDr
parents: 6484
diff changeset
    93
		EC_NONE,
ebabbe55f70e (svn r10489) -Codechange [YAPF]: FollowTrack_t now has new data member - m_err. It indicates the reason why the given track/trackdir can't be followed when method CFollowTrackT<>::Follow() returned false.
KUDr
parents: 6484
diff changeset
    94
		EC_OWNER,
ebabbe55f70e (svn r10489) -Codechange [YAPF]: FollowTrack_t now has new data member - m_err. It indicates the reason why the given track/trackdir can't be followed when method CFollowTrackT<>::Follow() returned false.
KUDr
parents: 6484
diff changeset
    95
		EC_RAIL_TYPE,
ebabbe55f70e (svn r10489) -Codechange [YAPF]: FollowTrack_t now has new data member - m_err. It indicates the reason why the given track/trackdir can't be followed when method CFollowTrackT<>::Follow() returned false.
KUDr
parents: 6484
diff changeset
    96
		EC_90DEG,
ebabbe55f70e (svn r10489) -Codechange [YAPF]: FollowTrack_t now has new data member - m_err. It indicates the reason why the given track/trackdir can't be followed when method CFollowTrackT<>::Follow() returned false.
KUDr
parents: 6484
diff changeset
    97
		EC_NO_WAY,
ebabbe55f70e (svn r10489) -Codechange [YAPF]: FollowTrack_t now has new data member - m_err. It indicates the reason why the given track/trackdir can't be followed when method CFollowTrackT<>::Follow() returned false.
KUDr
parents: 6484
diff changeset
    98
	};
ebabbe55f70e (svn r10489) -Codechange [YAPF]: FollowTrack_t now has new data member - m_err. It indicates the reason why the given track/trackdir can't be followed when method CFollowTrackT<>::Follow() returned false.
KUDr
parents: 6484
diff changeset
    99
4462
d67a579a5452 (svn r6245) -Add: added comments for all YAPF C interface functions (yapf.h) used by other modules, added FollowTrackInit() into YAPF track followers.
KUDr
parents: 3977
diff changeset
   100
	const Vehicle*      m_veh;           ///< moving vehicle
d67a579a5452 (svn r6245) -Add: added comments for all YAPF C interface functions (yapf.h) used by other modules, added FollowTrackInit() into YAPF track followers.
KUDr
parents: 3977
diff changeset
   101
	TileIndex           m_old_tile;      ///< the origin (vehicle moved from) before move
d67a579a5452 (svn r6245) -Add: added comments for all YAPF C interface functions (yapf.h) used by other modules, added FollowTrackInit() into YAPF track followers.
KUDr
parents: 3977
diff changeset
   102
	Trackdir            m_old_td;        ///< the trackdir (the vehicle was on) before move
d67a579a5452 (svn r6245) -Add: added comments for all YAPF C interface functions (yapf.h) used by other modules, added FollowTrackInit() into YAPF track followers.
KUDr
parents: 3977
diff changeset
   103
	TileIndex           m_new_tile;      ///< the new tile (the vehicle has entered)
d67a579a5452 (svn r6245) -Add: added comments for all YAPF C interface functions (yapf.h) used by other modules, added FollowTrackInit() into YAPF track followers.
KUDr
parents: 3977
diff changeset
   104
	TrackdirBits        m_new_td_bits;   ///< the new set of available trackdirs
d67a579a5452 (svn r6245) -Add: added comments for all YAPF C interface functions (yapf.h) used by other modules, added FollowTrackInit() into YAPF track followers.
KUDr
parents: 3977
diff changeset
   105
	DiagDirection       m_exitdir;       ///< exit direction (leaving the old tile)
d67a579a5452 (svn r6245) -Add: added comments for all YAPF C interface functions (yapf.h) used by other modules, added FollowTrackInit() into YAPF track followers.
KUDr
parents: 3977
diff changeset
   106
	bool                m_is_tunnel;     ///< last turn passed tunnel
5385
3868f2e6db9b (svn r7573) -Merged the bridge branch. Allows to build bridges of arbitrary rail/road combinations (including signals)
celestar
parents: 4870
diff changeset
   107
	bool                m_is_bridge;     ///< last turn passed bridge ramp
4462
d67a579a5452 (svn r6245) -Add: added comments for all YAPF C interface functions (yapf.h) used by other modules, added FollowTrackInit() into YAPF track followers.
KUDr
parents: 3977
diff changeset
   108
	bool                m_is_station;    ///< last turn passed station
d67a579a5452 (svn r6245) -Add: added comments for all YAPF C interface functions (yapf.h) used by other modules, added FollowTrackInit() into YAPF track followers.
KUDr
parents: 3977
diff changeset
   109
	int                 m_tiles_skipped; ///< number of skipped tunnel or station tiles
7211
ebabbe55f70e (svn r10489) -Codechange [YAPF]: FollowTrack_t now has new data member - m_err. It indicates the reason why the given track/trackdir can't be followed when method CFollowTrackT<>::Follow() returned false.
KUDr
parents: 6484
diff changeset
   110
	ErrorCode           m_err;
6248
e4a2ed7e5613 (svn r9051) -Codechange: typedef [enum|struct] Y {} X; -> [enum|struct] X {};
rubidium
parents: 6247
diff changeset
   111
};
3900
2c84ed52709d (svn r4987) Feature: Merged YAPF into trunk. Thanks to devs for continuous support and users for testing.
KUDr
parents:
diff changeset
   112
4462
d67a579a5452 (svn r6245) -Add: added comments for all YAPF C interface functions (yapf.h) used by other modules, added FollowTrackInit() into YAPF track followers.
KUDr
parents: 3977
diff changeset
   113
/** Initializes FollowTrack_t structure */
d67a579a5452 (svn r6245) -Add: added comments for all YAPF C interface functions (yapf.h) used by other modules, added FollowTrackInit() into YAPF track followers.
KUDr
parents: 3977
diff changeset
   114
void FollowTrackInit(FollowTrack_t *This, const Vehicle* v);
d67a579a5452 (svn r6245) -Add: added comments for all YAPF C interface functions (yapf.h) used by other modules, added FollowTrackInit() into YAPF track followers.
KUDr
parents: 3977
diff changeset
   115
d67a579a5452 (svn r6245) -Add: added comments for all YAPF C interface functions (yapf.h) used by other modules, added FollowTrackInit() into YAPF track followers.
KUDr
parents: 3977
diff changeset
   116
/** Main track follower routines */
3900
2c84ed52709d (svn r4987) Feature: Merged YAPF into trunk. Thanks to devs for continuous support and users for testing.
KUDr
parents:
diff changeset
   117
bool FollowTrackWater    (FollowTrack_t *This, TileIndex old_tile, Trackdir old_td);
2c84ed52709d (svn r4987) Feature: Merged YAPF into trunk. Thanks to devs for continuous support and users for testing.
KUDr
parents:
diff changeset
   118
bool FollowTrackRoad     (FollowTrack_t *This, TileIndex old_tile, Trackdir old_td);
2c84ed52709d (svn r4987) Feature: Merged YAPF into trunk. Thanks to devs for continuous support and users for testing.
KUDr
parents:
diff changeset
   119
bool FollowTrackRail     (FollowTrack_t *This, TileIndex old_tile, Trackdir old_td);
2c84ed52709d (svn r4987) Feature: Merged YAPF into trunk. Thanks to devs for continuous support and users for testing.
KUDr
parents:
diff changeset
   120
bool FollowTrackWaterNo90(FollowTrack_t *This, TileIndex old_tile, Trackdir old_td);
2c84ed52709d (svn r4987) Feature: Merged YAPF into trunk. Thanks to devs for continuous support and users for testing.
KUDr
parents:
diff changeset
   121
bool FollowTrackRoadNo90 (FollowTrack_t *This, TileIndex old_tile, Trackdir old_td);
2c84ed52709d (svn r4987) Feature: Merged YAPF into trunk. Thanks to devs for continuous support and users for testing.
KUDr
parents:
diff changeset
   122
bool FollowTrackRailNo90 (FollowTrack_t *This, TileIndex old_tile, Trackdir old_td);
2c84ed52709d (svn r4987) Feature: Merged YAPF into trunk. Thanks to devs for continuous support and users for testing.
KUDr
parents:
diff changeset
   123
4462
d67a579a5452 (svn r6245) -Add: added comments for all YAPF C interface functions (yapf.h) used by other modules, added FollowTrackInit() into YAPF track followers.
KUDr
parents: 3977
diff changeset
   124
/** Base tile length units */
3900
2c84ed52709d (svn r4987) Feature: Merged YAPF into trunk. Thanks to devs for continuous support and users for testing.
KUDr
parents:
diff changeset
   125
enum {
2c84ed52709d (svn r4987) Feature: Merged YAPF into trunk. Thanks to devs for continuous support and users for testing.
KUDr
parents:
diff changeset
   126
	YAPF_TILE_LENGTH = 100,
2c84ed52709d (svn r4987) Feature: Merged YAPF into trunk. Thanks to devs for continuous support and users for testing.
KUDr
parents:
diff changeset
   127
	YAPF_TILE_CORNER_LENGTH = 71
2c84ed52709d (svn r4987) Feature: Merged YAPF into trunk. Thanks to devs for continuous support and users for testing.
KUDr
parents:
diff changeset
   128
};
2c84ed52709d (svn r4987) Feature: Merged YAPF into trunk. Thanks to devs for continuous support and users for testing.
KUDr
parents:
diff changeset
   129
2c84ed52709d (svn r4987) Feature: Merged YAPF into trunk. Thanks to devs for continuous support and users for testing.
KUDr
parents:
diff changeset
   130
#endif /* YAPF_H */