~ubuntu-branches/debian/squeeze/openttd/squeeze

« back to all changes in this revision

Viewing changes to src/yapf/yapf.h

  • Committer: Bazaar Package Importer
  • Author(s): Jordi Mallach, Matthijs Kooijman, Jordi Mallach
  • Date: 2009-04-15 18:22:10 UTC
  • mfrom: (1.1.6 upstream) (2.1.3 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090415182210-22ktb8kdbp2tf3bm
[ Matthijs Kooijman ]
* New upstream release.
* Remove Debian specific desktop file, upstream provides one now. 
* Add debian/watch file.

[ Jordi Mallach ]
* Bump Standards-Version to 3.8.1, with no changes required.
* Move to debhelper compat 7. Bump Build-Depends accordingly.
* Use dh_prep.
* Add "set -e" to config script.
* Remove a few extra doc files that get installed by upstream Makefile.
* Add more complete copyright information.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $Id: yapf.h 12252 2008-02-25 15:09:22Z KUDr $ */
 
1
/* $Id: yapf.h 14949 2009-01-10 00:31:47Z rubidium $ */
2
2
 
3
 
/** @file yapf.h */
 
3
/** @file yapf.h Entry point for OpenTTD to YAPF. */
4
4
 
5
5
#ifndef  YAPF_H
6
6
#define  YAPF_H
7
7
 
8
8
#include "../debug.h"
 
9
#include "../depot_type.h"
 
10
#include "../direction_type.h"
 
11
#include "../pbs.h"
9
12
 
10
13
/** Finds the best path for given ship.
11
14
 * @param v        the ship that needs to find a path
14
17
 * @param tracks   available tracks on the new tile (to choose from)
15
18
 * @return         the best trackdir for next turn or INVALID_TRACKDIR if the path could not be found
16
19
 */
17
 
Trackdir YapfChooseShipTrack(Vehicle *v, TileIndex tile, DiagDirection enterdir, TrackBits tracks);
 
20
Trackdir YapfChooseShipTrack(const Vehicle *v, TileIndex tile, DiagDirection enterdir, TrackBits tracks);
18
21
 
19
22
/** Finds the best path for given road vehicle.
20
23
 * @param v        the RV that needs to find a path
22
25
 * @param enterdir diagonal direction which the RV will enter this new tile from
23
26
 * @return         the best trackdir for next turn or INVALID_TRACKDIR if the path could not be found
24
27
 */
25
 
Trackdir YapfChooseRoadTrack(Vehicle *v, TileIndex tile, DiagDirection enterdir);
 
28
Trackdir YapfChooseRoadTrack(const Vehicle *v, TileIndex tile, DiagDirection enterdir);
26
29
 
27
30
/** Finds the best path for given train.
28
31
 * @param v        the train that needs to find a path
30
33
 * @param enterdir diagonal direction which the RV will enter this new tile from
31
34
 * @param tracks   available trackdirs on the new tile (to choose from)
32
35
 * @param path_not_found [out] true is returned if no path can be found (returned Trackdir is only a 'guess')
 
36
 * @param reserve_track indicates whether YAPF should try to reserve the found path
 
37
 * @param target   [out] the target tile of the reservation, free is set to true if path was reserved
33
38
 * @return         the best trackdir for next turn or INVALID_TRACKDIR if the path could not be found
34
39
 */
35
 
Trackdir YapfChooseRailTrack(Vehicle *v, TileIndex tile, DiagDirection enterdir, TrackBits tracks, bool *path_not_found);
 
40
Trackdir YapfChooseRailTrack(const Vehicle *v, TileIndex tile, DiagDirection enterdir, TrackBits tracks, bool *path_not_found, bool reserve_track, PBSTileInfo *target);
36
41
 
37
42
/** Used by RV multistop feature to find the nearest road stop that has a free slot.
38
43
 * @param v      RV (its current tile will be the origin)
39
44
 * @param tile   destination tile
40
45
 * @return       distance from origin tile to the destination (number of road tiles) or UINT_MAX if path not found
41
46
 */
42
 
uint YapfRoadVehDistanceToTile(const Vehicle* v, TileIndex tile);
 
47
uint YapfRoadVehDistanceToTile(const Vehicle *v, TileIndex tile);
43
48
 
44
49
/** Used when user sends RV to the nearest depot or if RV needs servicing.
45
50
 * Returns the nearest depot (or NULL if depot was not found).
46
51
 */
47
 
Depot* YapfFindNearestRoadDepot(const Vehicle *v);
 
52
Depot *YapfFindNearestRoadDepot(const Vehicle *v);
48
53
 
49
54
/** Used when user sends train to the nearest depot or if train needs servicing.
50
55
 * @param v            train that needs to go to some depot
56
61
 * @param reversed     receives true if train needs to reversed first
57
62
 * @return       the true if depot was found.
58
63
 */
59
 
bool YapfFindNearestRailDepotTwoWay(Vehicle *v, int max_distance, int reverse_penalty, TileIndex* depot_tile, bool* reversed);
 
64
bool YapfFindNearestRailDepotTwoWay(const Vehicle *v, int max_distance, int reverse_penalty, TileIndex *depot_tile, bool *reversed);
60
65
 
61
66
/** Returns true if it is better to reverse the train before leaving station */
62
 
bool YapfCheckReverseTrain(Vehicle* v);
 
67
bool YapfCheckReverseTrain(const Vehicle *v);
 
68
 
 
69
/**
 
70
 * Try to extend the reserved path of a train to the nearest safe tile.
 
71
 *
 
72
 * @param v    The train that needs to find a safe tile.
 
73
 * @param tile Last tile of the current reserved path.
 
74
 * @param td   Last trackdir of the current reserved path.
 
75
 * @param override_railtype Should all physically compabtible railtypes be searched, even if the vehicle can't on them on it own?
 
76
 * @return True if the path could be extended to a safe tile.
 
77
 */
 
78
bool YapfRailFindNearestSafeTile(const Vehicle *v, TileIndex tile, Trackdir td, bool override_railtype);
63
79
 
64
80
/** Use this function to notify YAPF that track layout (or signal configuration) has change */
65
81
void YapfNotifyTrackLayoutChange(TileIndex tile, Track track);
66
82
 
67
83
/** performance measurement helpers */
68
 
void* NpfBeginInterval();
69
 
int NpfEndInterval(void* perf);
 
84
void *NpfBeginInterval();
 
85
int NpfEndInterval(void *perf);
70
86
 
71
87
 
72
88
extern int _aystar_stats_open_size;