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

« back to all changes in this revision

Viewing changes to src/ai/api/ai_road.hpp

  • Committer: Bazaar Package Importer
  • Author(s): Matthijs Kooijman, Matthijs Kooijman
  • Date: 2009-10-01 22:52:59 UTC
  • mfrom: (1.1.8 upstream) (2.1.6 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091001225259-5kpkp4sthbszpyif
[ Matthijs Kooijman ]
* New upstream release
* Use printf instead of echo -en in openttd-wrapper to make it POSIX
  compatible (Closes: #547758).
* Remove three patches that are now included in upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $Id: ai_road.hpp 15904 2009-03-30 23:22:13Z rubidium $ */
 
1
/* $Id: ai_road.hpp 17235 2009-08-20 12:22:31Z rubidium $ */
2
2
 
3
3
/** @file ai_road.hpp Everything to query and build roads. */
4
4
 
134
134
          * center of the second tile.
135
135
         * @param tile_from The source tile.
136
136
         * @param tile_to The destination tile.
 
137
         * @pre IsRoadTypeAvailable(GetCurrentRoadType()).
137
138
         * @pre AIMap::IsValidTile(tile_from).
138
139
         * @pre AIMap::IsValidTile(tile_to).
139
140
         * @pre 'tile_from' and 'tile_to' are directly neighbouring tiles.
197
198
         * Count how many neighbours are road.
198
199
         * @param tile The tile to check on.
199
200
         * @pre AIMap::IsValidTile(tile).
 
201
         * @pre IsRoadTypeAvailable(GetCurrentRoadType()).
200
202
         * @return 0 means no neighbour road; max value is 4.
201
203
         */
202
204
        static int32 GetNeighbourRoadCount(TileIndex tile);
237
239
         * @pre 'start' and 'end' are in a straight line, i.e.
238
240
         *  AIMap::GetTileX(start) == AIMap::GetTileX(end) or
239
241
         *  AIMap::GetTileY(start) == AIMap::GetTileY(end).
 
242
         * @pre IsRoadTypeAvailable(GetCurrentRoadType()).
240
243
         * @exception AIError::ERR_ALREADY_BUILT
241
244
         * @exception AIError::ERR_LAND_SLOPED_WRONG
242
245
         * @exception AIError::ERR_AREA_NOT_CLEAR
284
287
         * @pre 'start' and 'end' are in a straight line, i.e.
285
288
         *  AIMap::GetTileX(start) == AIMap::GetTileX(end) or
286
289
         *  AIMap::GetTileY(start) == AIMap::GetTileY(end).
 
290
         * @pre IsRoadTypeAvailable(GetCurrentRoadType()).
287
291
         * @exception AIError::ERR_ALREADY_BUILT
288
292
         * @exception AIError::ERR_LAND_SLOPED_WRONG
289
293
         * @exception AIError::ERR_AREA_NOT_CLEAR
328
332
         * @pre AIMap::IsValidTile(tile).
329
333
         * @pre AIMap::IsValidTile(front).
330
334
         * @pre 'tile' is not equal to 'front', but in a straight line of it.
 
335
         * @pre IsRoadTypeAvailable(GetCurrentRoadType()).
331
336
         * @exception AIError::ERR_FLAT_LAND_REQUIRED
332
337
         * @exception AIError::ERR_AREA_NOT_CLEAR
333
338
         * @return Whether the road depot has been/can be build or not.
344
349
         * @pre AIMap::IsValidTile(front).
345
350
         * @pre 'tile' is not equal to 'front', but in a straight line of it.
346
351
         * @pre station_id == AIStation::STATION_NEW || station_id == AIStation::STATION_JOIN_ADJACENT || AIStation::IsValidStation(station_id).
 
352
         * @pre GetCurrentRoadType() == ROADTYPE_ROAD.
347
353
         * @exception AIError::ERR_OWNED_BY_ANOTHER_COMPANY
348
354
         * @exception AIError::ERR_AREA_NOT_CLEAR
349
355
         * @exception AIError::ERR_FLAT_LAND_REQUIRED
350
356
         * @exception AIRoad::ERR_ROAD_DRIVE_THROUGH_WRONG_DIRECTION
351
357
         * @exception AIRoad::ERR_ROAD_CANNOT_BUILD_ON_TOWN_ROAD
352
 
         * @exception AIError:ERR_VEHICLE_IN_THE_WAY
 
358
         * @exception AIError::ERR_VEHICLE_IN_THE_WAY
353
359
         * @exception AIStation::ERR_STATION_TOO_CLOSE_TO_ANOTHER_STATION
354
360
         * @exception AIStation::ERR_STATION_TOO_MANY_STATIONS
355
361
         * @exception AIStation::ERR_STATION_TOO_MANY_STATIONS_IN_TOWN
359
365
 
360
366
        /**
361
367
         * Builds a drive-through road bus or truck station.
362
 
         * @param tile Place to build the depot.
 
368
         * @param tile Place to build the station.
363
369
         * @param front A tile on the same axis with 'tile' as the station shall be oriented.
364
370
         * @param road_veh_type Whether to build a truck or bus station.
365
371
         * @param station_id The station to join, AIStation::STATION_NEW or AIStation::STATION_JOIN_ADJACENT.
367
373
         * @pre AIMap::IsValidTile(front).
368
374
         * @pre 'tile' is not equal to 'front', but in a straight line of it.
369
375
         * @pre station_id == AIStation::STATION_NEW || station_id == AIStation::STATION_JOIN_ADJACENT || AIStation::IsValidStation(station_id).
 
376
         * @pre IsRoadTypeAvailable(GetCurrentRoadType()).
370
377
         * @exception AIError::ERR_OWNED_BY_ANOTHER_COMPANY
371
378
         * @exception AIError::ERR_AREA_NOT_CLEAR
372
379
         * @exception AIError::ERR_FLAT_LAND_REQUIRED
373
380
         * @exception AIRoad::ERR_ROAD_DRIVE_THROUGH_WRONG_DIRECTION
374
381
         * @exception AIRoad::ERR_ROAD_CANNOT_BUILD_ON_TOWN_ROAD
375
 
         * @exception AIError:ERR_VEHICLE_IN_THE_WAY
 
382
         * @exception AIError::ERR_VEHICLE_IN_THE_WAY
376
383
         * @exception AIStation::ERR_STATION_TOO_CLOSE_TO_ANOTHER_STATION
377
384
         * @exception AIStation::ERR_STATION_TOO_MANY_STATIONS
378
385
         * @exception AIStation::ERR_STATION_TOO_MANY_STATIONS_IN_TOWN
389
396
         * @pre 'start' and 'end' are in a straight line, i.e.
390
397
         *  AIMap::GetTileX(start) == AIMap::GetTileX(end) or
391
398
         *  AIMap::GetTileY(start) == AIMap::GetTileY(end).
 
399
         * @pre IsRoadTypeAvailable(GetCurrentRoadType()).
392
400
         * @exception AIError::ERR_OWNED_BY_ANOTHER_COMPANY
393
401
         * @exception AIError::ERR_VEHICLE_IN_THE_WAY
394
402
         * @exception AIRoad::ERR_ROAD_WORKS_IN_PROGRESS
406
414
         * @pre 'start' and 'end' are in a straight line, i.e.
407
415
         *  AIMap::GetTileX(start) == AIMap::GetTileX(end) or
408
416
         *  AIMap::GetTileY(start) == AIMap::GetTileY(end).
 
417
         * @pre IsRoadTypeAvailable(GetCurrentRoadType()).
409
418
         * @exception AIError::ERR_OWNED_BY_ANOTHER_COMPANY
410
419
         * @exception AIError::ERR_VEHICLE_IN_THE_WAY
411
420
         * @exception AIRoad::ERR_ROAD_WORKS_IN_PROGRESS