Public Member Functions |
| function | GetTilesAroundTown (town_id, width, height) |
| | Get a TileList around a town.
|
| function | BuildSingleRailStation (is_source, platform_length, route, station_data) |
| | Build a single (one-lane) rail station at a town or an industry.
|
| function | CanBuildSingleRailStation (tile, direction, platform_length, station_data) |
| | Check whether a single rail station can be built at the given position.
|
| function | BuildDoubleRailStation (is_source, route, station_data) |
| | Build a double (two-lane) rail station at a town or an industry.
|
| function | CanBuildDoubleRailStation (tile, direction, station_data) |
| | Determine whether a double rail station can be built at a given place.
|
| function | BuildRail (head1, head2, railbridges) |
| | Build a rail line between two given points.
|
| function | InternalBuildRail (head1, head2, railbridges, recursiondepth) |
| | Build a rail line between two given points.
|
| function | RetryRail (prevprev, pp1, pp2, pp3, head1, recursiondepth) |
| | Retry building a rail track after it was interrupted.
|
| function | BuildPassingLaneSection (near_source, station_data) |
| | Build a passing lane section between the current source and destination.
|
| function | CanBuildPassingLaneSection (centre, direction, reverse) |
| | Determine whether a passing lane section can be built at a given position.
|
| function | BuildAndStartTrains (number, length, engine, wagon, ordervehicle, group, route_data, station_data, engineblacklist) |
| | Build and start trains for the current route.
|
| function | MailWagonWorkaround (mailwagon, firstwagon, trainengine, crg) |
| | A workaround for refitting the mail wagon separately.
|
Static Public Member Functions |
| static function | ChooseWagon (cargo, blacklist) |
| | Choose a rail wagon for the given cargo.
|
| static function | ChooseTrainEngine (cargo, distance, wagon, num_wagons, blacklist) |
| | Choose a train locomotive.
|
| static function | TrainEngineValuator (engine, weight, max_speed, money) |
| | A valuator function for scoring train locomotives.
|
Define the WormRailBuilder class which handles trains.
| function WormRailBuilder::BuildDoubleRailStation |
( |
is_source |
, |
|
|
route |
, |
|
|
station_data |
|
|
) |
| |
Build a double (two-lane) rail station at a town or an industry.
Builder class variables used: crg, src, dst, srcplace, dstplace, srcistown, dstistown, statile, deptile, stafront, depfront, frontfront, front1, front2, lane2, morefront Builder class variables set: stasrc, stadst, homedepot
- Parameters
-
| is_source | True if we are building the source station. |
| route | A WormRoute class object containing info about the route. |
| station_data | A WormStation class object containing info about the station. |
- Returns
- True if the construction succeeded.
- Todo:
- RemoveRailLine
| function WormRailBuilder::BuildSingleRailStation |
( |
is_source |
, |
|
|
platform_length |
, |
|
|
route |
, |
|
|
station_data |
|
|
) |
| |
Build a single (one-lane) rail station at a town or an industry.
Builder class variables used: crg, src, dst, srcplace, dstplace, srcistown, dstistown, statile, stafront, depfront, frontfront, statop, stationdir Builder class variables set: stasrc, stadst, homedepot
- Parameters
-
| is_source | True if we are building the source station. |
| platform_length | The length of the new station's platform. (2 or 3) |
| route | A WormRoute class object containing info about the route. |
| station_data | A WormStation class object containing info about the station. |
- Returns
- True if the construction succeeded.
- Todo:
- RemoveRailLine
| function WormRailBuilder::CanBuildDoubleRailStation |
( |
tile |
, |
|
|
direction |
, |
|
|
station_data |
|
|
) |
| |
Determine whether a double rail station can be built at a given place.
Builder class variables set: statile, deptile, stafront, depfront, front1, front2, lane2, frontfront, morefront, statop, stabottom
- Parameters
-
| tile | The tile to be checked. |
| direction | The direction of the proposed station. |
| station_data | WormStation class object where the build info will be store (should be non null when called). |
- Returns
- Ture if a double rail station can be built at the given position.
| function WormRailBuilder::CanBuildSingleRailStation |
( |
tile |
, |
|
|
direction |
, |
|
|
platform_length |
, |
|
|
station_data |
|
|
) |
| |
Check whether a single rail station can be built at the given position.
Builder class variables set: statop, stabotton, statile, stafront, depfront, frontfront
- Parameters
-
| tile | The tile to be checked. |
| direction | The direction of the proposed station. |
| platform_length | The length of the proposed station's platform. (2 or 3) |
| station_data | WormStation class object where the build info will be store (should be non null when called). |
- Returns
- True if a single rail station can be built at the given position.