… | |
… | |
101 | struct vehicle *v; |
101 | struct vehicle *v; |
102 | int try_harder; |
102 | int try_harder; |
103 | }; |
103 | }; |
104 | |
104 | |
105 | |
105 | |
|
|
106 | /** |
|
|
107 | * @brief Usually represents a destination or position |
|
|
108 | * |
|
|
109 | * This struct usually represents a destination or position |
|
|
110 | */ |
106 | struct route_info; |
111 | struct route_info |
|
|
112 | { |
|
|
113 | struct coord c; /**< The actual destination / position */ |
|
|
114 | struct coord lp; /**< The nearest point on a street to c */ |
|
|
115 | int pos; /**< The position of lp within the coords of the street */ |
|
|
116 | int lenpos; /**< Distance between lp and the end of the street */ |
|
|
117 | int lenneg; /**< Distance between lp and the start of the street */ |
|
|
118 | int lenextra; /**< Distance between lp and c */ |
|
|
119 | int percent; /**< ratio of lenneg to lenght of whole street in percent */ |
|
|
120 | struct street_data *street; /**< The street lp is on */ |
|
|
121 | int street_direction; /**< Direction of vehicle on street -1 = Negative direction, 1 = Positive direction, 0 = Unknown */ |
|
|
122 | int dir; /**< Direction to take when following the route -1 = Negative direction, 1 = Positive direction */ |
|
|
123 | }; |
|
|
124 | |
107 | struct street_data; |
125 | struct street_data; |
108 | struct tracking; |
126 | struct tracking; |
109 | struct vehicleprofile; |
127 | struct vehicleprofile; |
110 | struct route *route_new(struct attr *parent, struct attr **attrs); |
128 | struct route *route_new(struct attr *parent, struct attr **attrs); |
111 | void route_set_mapset(struct route *this_, struct mapset *ms); |
129 | void route_set_mapset(struct route *this_, struct mapset *ms); |
… | |
… | |
118 | int route_destination_reached(struct route *this_); |
136 | int route_destination_reached(struct route *this_); |
119 | void route_set_position(struct route *this_, struct pcoord *pos); |
137 | void route_set_position(struct route *this_, struct pcoord *pos); |
120 | void route_set_position_from_tracking(struct route *this_, struct tracking *tracking, enum projection pro); |
138 | void route_set_position_from_tracking(struct route *this_, struct tracking *tracking, enum projection pro); |
121 | struct map_selection *route_rect(int order, struct coord *c1, struct coord *c2, int rel, int abs); |
139 | struct map_selection *route_rect(int order, struct coord *c1, struct coord *c2, int rel, int abs); |
122 | void route_set_destinations(struct route *this_, struct pcoord *dst, int count, int async); |
140 | void route_set_destinations(struct route *this_, struct pcoord *dst, int count, int async); |
|
|
141 | void route_add_destination(struct route *this, struct pcoord *dst, int async); |
123 | int route_get_destinations(struct route *this_, struct pcoord *pc, int count); |
142 | int route_get_destinations(struct route *this_, struct pcoord *pc, int count); |
124 | void route_set_destination(struct route *this_, struct pcoord *dst, int async); |
143 | void route_set_destination(struct route *this_, struct pcoord *dst, int async); |
125 | void route_remove_waypoint(struct route *this_); |
144 | void route_remove_waypoint(struct route *this_); |
126 | struct coord route_get_coord_dist(struct route *this_, int dist); |
145 | struct coord route_get_coord_dist(struct route *this_, int dist); |
127 | struct street_data *street_get_data(struct item *item); |
146 | struct street_data *street_get_data(struct item *item); |
… | |
… | |
139 | struct attr_iter * route_attr_iter_new(void); |
158 | struct attr_iter * route_attr_iter_new(void); |
140 | void route_attr_iter_destroy(struct attr_iter *iter); |
159 | void route_attr_iter_destroy(struct attr_iter *iter); |
141 | int route_get_attr(struct route *this_, enum attr_type type, struct attr *attr, struct attr_iter *iter); |
160 | int route_get_attr(struct route *this_, enum attr_type type, struct attr *attr, struct attr_iter *iter); |
142 | void route_init(void); |
161 | void route_init(void); |
143 | void route_destroy(struct route *this_); |
162 | void route_destroy(struct route *this_); |
|
|
163 | void route_path_destroy(struct route_path *this, int recurse); |
|
|
164 | void route_graph_destroy(struct route_graph *this); |
144 | /* end of prototypes */ |
165 | /* end of prototypes */ |
145 | #ifdef __cplusplus |
166 | #ifdef __cplusplus |
146 | } |
167 | } |
147 | #endif |
168 | #endif |
148 | |
169 | |